Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Power BI Notes

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 9

1. What exactly do you mean by time intelligence functions in power bi ?

Can you
explain three important time intelligence functions?

Answer :- In Power BI, time intelligence functions are a set of DAX (Data Analysis
Expressions) functions designed to perform calculations and analysis based on time-
related dimensions. These functions are particularly useful when working with date
or time-based data in Power BI. Here are three important time intelligence
functions in Power BI:

TOTALYTD:
The TOTALYTD function calculates the total for a specified expression year-to-date.
It is commonly used to create cumulative measures for a given period. You can use
it to get a running total of a measure from the beginning of the year up to the
current date.

Example:
DAX
Total Sales YTD = TOTALYTD(SUM(Sales[Amount]), 'Date'[Date])

TOTALMTD:
The TOTALMTD function calculates the total for a specified expression month-to-
date. It is similar to TOTALYTD but works on a monthly basis, providing a running
total from the beginning of the month up to the current date.

Example:
DAX
Total Sales MTD = TOTALMTD(SUM(Sales[Amount]), 'Date'[Date])

SAMEPERIODLASTYEAR:
The SAMEPERIODLASTYEAR function returns a table that contains a parallel period to
the one specified but from the previous year. This is useful for comparing metrics
and identifying year-over-year trends.

Example:
DAX
Sales LY = CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR('Date'[Date]))

These functions are just a few examples of the time intelligence functions
available in Power BI. Depending on your specific requirements, you may also use
functions like DATESBETWEEN, DATESINPERIOD, and others to perform various time-
based calculations and comparisons in your Power BI reports and dashboards. Time
intelligence functions help analysts and report developers gain insights into
trends, seasonality, and other time-related patterns in their data.

2.What is the difference between implicit function and explicit function in power
bi ?

Answer :-In the context of Power BI or data analysis tools like DAX (Data Analysis
Expressions), the terms "implicit function" and "explicit function" are not
standard terminologies. However, we can discuss how concepts similar to implicit
and explicit functions might be relevant in this context.

Implicit Measures (Similar to Implicit Functions):


In Power BI, when you create visualizations or build calculations using the user
interface (UI) without explicitly writing DAX formulas, it can be considered
analogous to an implicit approach. For example, if you drag and drop a field onto a
visualization, Power BI automatically generates a measure or aggregation (like SUM)
for you. This is implicit in the sense that you are not explicitly writing the DAX
code; the tool is inferring it for you.

Explicit Measures (Similar to Explicit Functions):


On the other hand, explicit measures in Power BI involve explicitly writing DAX
formulas to define calculations or aggregations. When you use the DAX formula bar
to create a new measure or column, you are providing a specific expression or
function that defines the calculation explicitly.

Example of explicit DAX formula:


DAX
Total Sales = SUM('Sales'[Amount])

In summary, while the terms "implicit function" and "explicit function" are not
standard in the Power BI context, we can draw parallels to the concepts of implicit
and explicit measures. Implicit measures are created through the tool's interface,
while explicit measures involve writing DAX formulas directly. The choice between
them depends on the complexity of the calculation and the level of control you want
over the logic and expressions used in your Power BI reports and dashboards.

3. What is the difference between calculated columns and calculated measures in


power bi ?

Answer :-In Power BI, calculated columns and calculated measures are both ways to
create new data elements, but they serve different purposes and have distinct
characteristics.

Calculated Columns:

Definition: A calculated column is a new column added to a table in your Power BI


model, and its values are calculated for each row in the table.
Calculation: The calculation for a calculated column is based on a DAX formula, and
it is typically evaluated row by row within the table.
Context: Calculated columns become a part of the underlying table structure and are
best suited for scenarios where the calculation is dependent on the context of each
individual row.
Usage: Calculated columns are useful for creating new columns based on existing
column values, performing row-level calculations, or transforming data at the row
level.

Example of a calculated column:


DAX
Profit Margin = 'Sales'[Profit] / 'Sales'[Revenue]

Calculated Measures:

Definition: A calculated measure is a dynamic calculation that is applied in the


context of a report or visualization. It does not add a new column to the table but
rather provides a way to create aggregations, ratios, or other calculations on the
fly.
Calculation: Calculated measures are calculated on the fly, typically in the
context of a visual or a report, based on the data that is currently being
displayed.
Context: Calculated measures are well-suited for scenarios where you need to
aggregate or perform calculations across multiple rows or tables.
Usage: Calculated measures are used for creating key performance indicators (KPIs),
aggregations, ratios, and other calculations that involve summarizing data.
Example of a calculated measure:
DAX
Total Sales = SUM('Sales'[Amount])

In summary, the key difference between calculated columns and calculated measures
in Power BI is that calculated columns add new columns to the table structure and
are evaluated row by row, while calculated measures provide dynamic calculations
that aggregate or summarize data and are used in reports or visualizations. The
choice between them depends on the nature of the calculation and whether it is
better suited for row-level or aggregate-level operations.

4. Can you explain the working of calculate function in power bi ?

Answer :- Certainly! The CALCULATE function in Power BI is a powerful and versatile


DAX (Data Analysis Expressions) function that is used to modify the context in
which a calculation is performed. It allows you to override or modify the filter
context, row context, or both, for a given expression. This function is crucial for
creating complex calculations and manipulating the evaluation context in Power BI.

The general syntax of the CALCULATE function is as follows:


DAX
CALCULATE(<expression>, <filter1>, <filter2>, ...)
<expression>: The expression or measure that you want to evaluate.
<filter1>, <filter2>, ...: Optional filters that modify the context in which the
expression is evaluated.

Here are the key concepts to understand how the CALCULATE function works:

Filter Context:

In Power BI, the filter context is the set of filters that are automatically
applied to a calculation based on the report context, such as slicers, filters on
visuals, or row-level security. CALCULATE allows you to temporarily modify this
filter context.

Row Context:
Row context is the context in which a calculation is performed for each row in a
table. When iterating over rows, DAX formulas operate in a row context. CALCULATE
can also be used to modify the row context.

Modifying Filter Context:


You can use CALCULATE to modify the filter context by providing filter conditions.
For example, you might want to calculate a measure as if a specific filter or
condition is applied, even if it's not present in the current filter context.

DAX
Total Sales in 2023 = CALCULATE(SUM('Sales'[Amount]), 'Date'[Year] = 2023)

Nested CALCULATE Functions:


You can nest CALCULATE functions to create more complex expressions. Each nested
CALCULATE can introduce additional filter conditions or modify the context further.

DAX
Profit Margin in 2023 = CALCULATE(
DIVIDE(SUM('Sales'[Profit]), SUM('Sales'[Revenue])),
'Date'[Year] = 2023
)
Context Transition:
CALCULATE also performs a context transition when moving from row context to filter
context. This transition is essential for understanding how filters propagate
through the calculations.

DAX
Total Sales for Each Product = SUMX('Product', CALCULATE(SUM('Sales'[Amount])))

In summary, the CALCULATE function in Power BI is a powerful tool for manipulating


the filter and row contexts, allowing you to control how calculations are performed
and providing flexibility in creating sophisticated measures and calculations.
Understanding the filter and row context is crucial for using CALCULATE effectively
in your Power BI reports.

5. How do you handle a scenario where we have missing values or incomplete data
especially when we have to apply time intelligence functions in power bi ?

Answer :-Handling missing values or incomplete data is a common challenge in data


analysis, and when dealing with time intelligence functions in Power BI, it becomes
even more crucial. Here are some strategies to address missing values and
incomplete data in Power BI, especially when applying time intelligence functions:

Fill or Replace Missing Values:


Use DAX functions like IF or COALESCE to replace missing values with zeros or other
default values. This can help ensure that calculations involving those values are
still meaningful.

DAX
Sales Amount (Filled) = IF(ISBLANK('Sales'[Amount]), 0, 'Sales'[Amount])

Fill Gaps in Time Series Data:


If you have missing dates in your time series data, consider creating a calendar
table and using it to fill in gaps. This ensures that you have a complete sequence
of dates, even if some dates have no corresponding data.

DAX
Total Sales = CALCULATE(SUM('Sales'[Amount]), 'Calendar'[Date])

Interpolate or Extrapolate Values:


Use interpolation or extrapolation techniques to estimate missing values based on
the surrounding data points. DAX functions like INTERPOLATE or custom calculations
can be applied for this purpose.

Time-aware Aggregations:
Utilize time intelligence functions that automatically handle missing values. For
instance, functions like TOTALYTD or TOTALMTD in Power BI are designed to work with
time-related data and naturally handle missing values by considering the available
data points.

DAX
Total Sales YTD = TOTALYTD(SUM('Sales'[Amount]), 'Date'[Date])

Data Quality Checks:


Regularly perform data quality checks to identify and address missing or incomplete
data. This can involve using features in Power BI to highlight or filter out
problematic data points.

Use Relationships and Cross Filtering:


Leverage relationships between tables and cross-filtering capabilities to handle
missing data. Ensure that relationships are correctly established, and use
relationships to propagate filters across tables.

Dynamic Slicing and Dicing:


Allow users to dynamically slice and dice data using slicers or other interactive
features. This can help users focus on specific time periods or dimensions where
data is more complete.

Custom Handling with DAX:


For more advanced scenarios, write custom DAX expressions to handle missing values
based on specific business rules or requirements.

By combining these strategies, you can enhance the robustness of your Power BI
reports and dashboards when dealing with missing values or incomplete data,
especially in the context of time intelligence functions. Choose the approach that
best fits your data and analysis requirements.

6. Suppose,you have three tables in power querry and structure of all those three
tables are similar to each other.Now you went ahead and appended those three
tables.Now if you want to do the close and applyer what will happen all those
initial tables plus that appended table containing the data of all those three
tables will be loaded in power bi but I don't want those three tables to be
loaded,I only want that appended table to be loaded in power bi.So, how will you
manage this?

Answer :-So,in power querry we have option to enable load then from there we have
to check that and then we will close and apply then only that particular marged
querry will be loaded into our power bi data model.

7. Suppose,you have one column and columns contains email ID of different people
and that email ID is like this -nitishkumar@gmail.com for example.Similarly other
email IDs are there.Now if i want to rxtract the first part of that email ID for
example nitish to create the new column which contains the first name then how will
you extract that first name from that email ID column?

Answer :-So,in power query we have in transform tab we have a option to split to
delimeter then by using that split by delimeter we will be passing the delimeter on
which we want to split the column and then we will able to split that column based
upon that delimeter.

8. Have you used index column? So,in what kind of scenario do we use index column?

Answer :- Yes,I have used index column.In my case,my table was not having a primary
key and I wanted to establish a relationship between two tables.So,for that purpose
I have created a index column in my dimension table and then created the
relationship between both that tables using the index columns.

9. Suppose,you want to check if there is any column in a table and you want to
check how many distinct values that column contain,so how can you check that in
power query?

Answer :-In power query,inside the view tab we have to option to check column
profile.After going into that tab we will just click on that particular column and
then we will chek on column quality or column profile then from that we able to get
a summary of our column where we will be able to see how many distinct value our
column is containing and how many total values our column is having.

Question :- If suppose that column contains around 20,000 records and column
profile will show only the top 1000 values. So,according to that top 1000 values it
will tell what is the distinct and all. So how can we see the overall distinct
values if you have to see the overall 20,000 records of that column?

Answer :-

10. Do you know like have you applied merge functionallity?Can you tell me what is
merge?

Answer :-Yes. Basically,its similar to join in SQL.So,suppose we want to create a


master table based upon some other table the in that case we want join two
tables.So,by using common column between both that tables we can create that master
table.So,in merge query we have options like left join,right join,left anti join,
inner join,right anti join.

Question :-What is left anti join?

Answer :-In left anti join,we will get only that record which are presents in the
left table.Basically,we will get the unmatching record from left table means all
the record which are only present in the left table but that is not present in the
right table.

11. How do you differentiate that this table is a fact table or this table is a
dimension table,how do you differentiate that?

Answer :-Generally in fact table there are more number of data presents like there
are there are more number of rows presents and if we see that there are some
columns which are repeating in the table then in that case we will consider that
table as a fact table but what happens in a dimension table data's are not repeated
means we will be getting only the distinct data means distinct rows name we will be
getting in the dimension table.Fact table will be containing the quantitative data
and dimension table will be containing the qualitative data means dimension table
will be having information about any particular dimension.

12. Can you explain what is a snowflake schema?

Answer :-In slope,basically it's a verion of star schema in which dimension table
is further normalized.So,suppose we have a dimension table called product and
inside that product table we have the sub-category of product then for every sub-
category of the product,product name is repeating then in that what will we do we
will create another time dimension table which will be linked to our product
table.So,this is the snowflake schema.

Question :-So,you use the term normalization.What is normalization?

Answer :-Normalization means it's a process to organize the data in our relational
model in such a way that we reduce the data redundency.

13.What is cardinality?So,ideally what kind of cardinality we should prefer?

Answer :-Cardinality means the represents the relationship between two tables like
how these two tables are related. So,this can be one to one,many to many.

--->Ideally we should prefer one to many relationship.

14. What kind of visuals you have used till now?

Answer :-Bar graph,stack bar,stack bar chart,scatter plot,pie chart,donut


chart,line chart.These kind of visuals I have used.

Question :- How will you diffrentiate a donut chart with a pie chart?
Answer :-In pie chart,we have information present in the form of slices while in
the donut chart we have the information present in the form of arcs and in the
donut chart there is a hole inbetween and in pie chart there is no hole
inbetween.So,basically donut cahrt is just a variation of pie chart means it based
upon requirement like what kind of visuals will be suited for our visualization
then in that case we prefer to use donut chat or pie chart.

15. Suppose,you have a slicer and that slicer is present is multiple pages.Now if I
select something in that slicer the same slicer is present in other pages also of
the report. So,if I select something I want that selection should be visible in
other pages of the report also.How it can be made possible?

Answer :-There is option to sync slicers.So,if we enable that option then we will
be able to do this thing.

16. What is the page level filter?

Answer :-Page level filter like if we apply any filter through filter pin and from
that page if we have applied that filter for any particular page then that filter
will be applied to only particular page and if we go to any other page then that
page will not be affected by this filter.

Question :-Have you set up drill through filter till now in any of your reports?How
do we do that drill through?

Answer :-Yes.Firstly for drill through filter we must have a hierarchy of datalike
if we want to enable drill through for some data column then we must have a
hierarchy of year then month and then date and when we drag and drop that thing on
our then that will be automatically enabled in our visual and there is a fork like
icon available in our visual and if we click on that fork like icon then we will be
able to drill through our visual.

17. Do you know how to set up a custom tool tip?

Answer :-Yes.firstly we have to create a new page and in the canvas setting we have
to set that page as a tool tip then for that page we have to enable tool tip and on
the page on any particular visual for which we want to that tool tip to be visual
so we have to link that tool tip to that particular visual then if we hover over
that visual then we will be able to see that tool tip in our visual.

18. What kind of DAX functions you have used till now?

Answer :- Filter function,Time intelligence function,Text function,some table


funnctions I have used all these kind of functions.

19. What is DAX in power bi and give an example?

Answer :-DAX is a collection of functions, operators, and constants that can be


used in a formula, or expression, to calculate and return one or more values. DAX
helps you create new information from data already in your model.

20. How you disable a graph that is changing dynamically in power bi ?

Answer :-To disable a graph that is changing dynamically in Power BI, you can
follow these steps:

Create a button above the visual you want to control. Name the button according to
the visual’s purpose (e.g., “Pie Chart” or “Bar Chart”).
Use the Selection pane to see all the visuals on your report and their visibility
settings.
Click on the visibility icon next to the visual you would like to hide.
To show the visual again, click the button you created for that specific visual.
Note that Power BI allows you to turn off interactions between visuals, which can
be useful when you want to prevent certain visuals from affecting others. To do
this, follow these additional steps:

Click on the visual that you want to control interactions for.


Click on “Edit interactions.”
Change the interaction to “None” or “No interaction.”
By disabling interactions, you can prevent changes in one visual from affecting
other visuals on your report. This can help keep your report clean, focused, and
easier to interpret.

21. Explain RLS(Row Level Security) and how do you implement RLS in power bi ?

Answer :-Row-level security (RLS) is a data governance feature in Power BI that


allows developers and admins to restrict data access for given users based on the
logic applied at the row level. RLS can be configured for data models imported into
Power BI with Power BI Desktop or datasets using DirectQuery, such as SQL Server.
Filters can be defined within roles to restrict data access at the row level.
However, RLS does not restrict data access for members of a workspace in the Power
BI service. RLS can be implemented for different use cases such as location-based,
business-line-based, and employee-based. RLS is not respected if the DirectQuery
connection uses integrated authentication for report readers.

22. Explain the processing of publishing a report?

Answer :-In Power BI Desktop, choose File > Publish > Publish to Power BI or select
Publish on the Home ribbon.Sign in to Power BI if you aren't already signed
in.Select the destination. You can search your list of available workspaces to find
the workspace into which you want to publish. The search box lets you filter your
workspaces. Select the workspace, and then click the Select button to publish.When
publishing is complete, you receive a link to your report. Select the link to open
the report in your Power BI site.

23. How to create relationships in power bi?

Answer :-On the Modeling tab, select Manage relationships > New.In the Create
relationship dialog box, in the first table drop-down list, select a table. Select
the column you want to use in the relationship.In the second table drop-down list,
select the other table you want in the relationship. Select the other column you
want to use, and then select OK.

If you encounter that error, there are a couple ways to fix the issue:

Use Remove Duplicates to create a column with unique values. The drawback to this
approach is that you might lose information when duplicate rows are removed. Often
a key (row) is duplicated for good reason.Add an intermediary table made of the
list of distinct key values to the model, which will then be linked to both
original columns in the relationship.

24. How to edit relationships in power bi?

Answer :-There are two ways to edit a relationship in Power BI.

The first method to edit a relationship is using the Editing relationships in the
Properties pane in Model view, where you can select any line between two tables to
see the relationship options in the Properties pane. Be sure to expand the
Properties pane to see the relationship options.The other method of editing a
relationship is using the Relationship editor dialog, which you can open many ways
from within Power BI Desktop. The following list shows different ways you can open
the Relationship editor dialog.

From Report view do any of the following:

Select the Modeling ribbon > Manage relationships, then select the relationship and
select Edit.
Select a table in the Fields list then select the Table tools ribbon > Manage
relationships, then select the relationship and then select Edit.
From the Data view, select the Table tools ribbon > Manage relationships, then
select the relationship and then choose Edit.

From the Model view do any of the following:

Select the Home ribbon > Manage relationships, then choose the relationship and
then select Edit.
Double-click any line between two tables.
Right-click any line between two tables and then choose Properties.
Select any line between two tables, then choose Open relationship editor in the
Properties pane.

25. how to schedule refresh in power bi?

Answer :-

26.

You might also like