Powerbi - 1688813655261
Powerbi - 1688813655261
For
POWER BI
Website: www.analytixlabs.co.in
Email: [email protected]
Disclaimer: This material is protected under copyright act AnalytixLabs©, 2011-2023. Unauthorized use
and/ or duplication of this material or any part of this material including data, in any form without
explicit and written permission from AnalytixLabsis strictly prohibited. Any violation of this copyright
will attract legal actions.
Power BI is a business analytics tool developed by Microsoft that allows users to visualize and analyse data
from various sources in very interactive manner.
Calculated column is a new column which we create by defining calculations and these calculations can be
our concatenate calculations where we might be using it to combine two or more columns’ data or some
DAX functions like Date, format, Related and so on, so this DAX calculations is performed for each row data
in the Table not for entire table data.
Now before you end your answer, to create more impact on your answer you can also tell some benefits of
creating new column. i.e. you can say that in a data model one benefit of creating calculated column is to
establish relationship between tables when no unique field exist.
So, in simple words if u need a new column with some massaged data or transformed data rows then
we can use calculated column.
The main components of Power BI are Power BI Desktop, Power BI Service, and Power BI Mobile.
Power BI Desktop is a Windows application used to create reports and visualizations, while Power BI Service
is a cloud-based platform used to publish, share, and collaborate on reports.
A data model in Power BI is a collection of tables, relationships, and calculations that define how data is
organized and structured within the application.
Now to answer this question you can tell that: There are multiple ways we can create calculated columns
Go to fields then choose any table where you want to create column and click on dotted lines that say
new column as shown in below image.
You can also go to table tools and say new column to create column (This option available in data model)
Q. How do you import data into Power BI?
Data can be imported into Power BI by connecting to various data sources such as databases, Excel files, CSV
files, and web services.
Measures are just another way of defining calculations in data model. Measures are also known as Power BI
DAX expression and we use these DAX functions for doing analysis, calculation, forecasting and many more.
Measure works for entire table and depending on context it automatically changes its value. So, popular DAX
functions are like...Calculate, Filter, Sum, Average, Min, Max and many more these functions are divided as
per logical, time, date, table, filter, iteration wise and so on. Whenever we create a measure in a table a
special calculator symbol is represented as you can see in below image.
DAX (Data Analysis Expressions) is a formula language used in Power BI to create custom calculations and
measures.
Visualizations can be created in Power BI by selecting a data source, choosing a visualization type, and
dragging and dropping fields onto the visualization canvas.
A new column name added in Data model A new measure is created but not added to
Here we can view data in added in new Here we cannot view data added in measure
column
Evaluated for each row in our table Evaluated when we use it in any visualization
and this evaluation happens on entire
dataset of table
Columns are also called as static row-level Measures are also called as dynamic
attributes aggregations
Here New Column Occupies Space in PBIX file Here Measure does not occupy any space but
yes it occupies space in cache level
Columns are useful to create relationship Here measures are useful to do only
between tables where unique field does not aggregation
exits
Power BI reports can be shared by publishing them to the Power BI Service or exporting them to different file
formats such as PDF or PowerPoint.
Yes, you can schedule data refreshes in Power BI to ensure that reports and dashboards are always up to
date.
Q. What are M codes in power bi & where can you write Power Query M Code?
In Power BI, M codes are used in the Power Query zone for data transformation. M-code, also known as M-
Language, is used to clean and structure data according to specific requirements. It is categorized into
Logical, Date, Number, Text, Table, and other types.
M-code is used to perform tasks such as removing nulls, errors, and bad data, as well as structuring data in
different models like snowflake or star schema. Power BI offers a wide range of M-functions, numbering in
the thousands, which can be utilized based on specific needs.
When performing actions in the Power Query editor, such as replacing values, removing columns, appending
queries, or adding columns, automatic M-code is generated as steps are taken. However, if one prefers to
write M-code manually, they can access the Advanced Editor option or use the Custom Column feature to
write custom M-functions.
To create a calculated column, you can use the "Modelling" tab in Power BI Desktop and choose "New
Column" from the "Calculations" group.
Power BI offers a wide range of visualizations, including bar charts, line charts, pie charts, tables, maps,
matrices, and more.
Answer is yes if your data lies on on-premises data sources. if your data is somewhere in azure or azure sql
server, one drive or SharePoint then we don’t need data gateways.
The process of sending Transformed Native Query (Query which is part of Power Q) back to data source to
get only transformed column data are known as Query Folding. So, in simple words Query Folding gives you
optimized columns datadepending on your transformation requirement by sending native Query back to
source data.
Now this Query Folding only works with only Relational DBS, Active directories not with any other sources
like Excel, CSV.
In order to take Query Folding optimization advantage, do the steps and check each step if it is generating
native query or now. If not then alter steps accordingly.
For example, you can see that from above image a new step is created with new native query and now
power bi will send this last or final native query back to data source (SQL server in my case). This return
back optimization columns are known as Query Folding.
Q. How can you filter data in Power BI?
Data can be filtered in Power BI using slicers, visual level filters, page level filters, or by creating custom filter
expressions.
Split Function is a part of Power Query editor and it is useful to split data into different columns based on
delimiter, number of characters and by position. A nice example is shown below where one column data is
split into multiple columns based on delimiter.
Row-level security in Power BI allows you to restrict data access based on user roles or attributes.
Drill-through actions can be created in Power BI by defining drill-through pages and specifying the drill-
through filters.
Yes, Power BI supports the creation and integration of custom visuals developed using the Power BI visuals
SDK.
Power BI supports live connections to various data sources such as SQL Server Analysis Services, Azure
Analysis Services, and Power BI datasets.
Q. Difference between visual level, page level and report level filters in Power BI?
Page level filter will able to filter all visuals present in a single page
Example of Page Level Filter Image:
Report level filter will able to filter all visuals present current page and also present all current pbix report.
These filters can filter can visuals based on selected data fields.
Definition: All function. All function helps us Definition: This function also works similarly
to remove any filters from the context that like All function. It also helps us to remove
might have been applied and then returns filter not just filter but all filters except
the necessary value. column which is specified in that All except
function and then returns the necessary
value.
Syntax: Syntax:
It removes filter on table name or column Except column name which is applied in the
name which is applied in the function function, it removes all other filters.
Here we can specify either particular table Here we can specify only column name along
name or column name with dataset name
All is also a comes under table functions Allexcept is also a comes under table
function
Hierarchies can be created in Power BI by selecting the relevant fields and using the "Create Hierarchy"
option in the modelling tab.
Yes, Power BI supports conditional formatting to highlight data based on specific conditions or rules.
The Power BI gateway is a software component that allows you to securely connect on-premises data sources
to the Power BI service.
To create a calculated measure, you can use the "Modelling" tab in Power BI Desktop and choose "New
Measure" from the "Calculations" group.
Yes, you can create a calculated table in Power BI by using DAX formulas to define the table's structure and
content.
Report templates can be created in Power BI by designing a report with the desired structure and visuals,
saving it as a template (.pbit file), and using it as a starting point for future reports.
Data modelling in Power BI is crucial as it determines how data is structured, relationships are established,
and calculations are performed, ensuring accurate and meaningful analysis.
Power BI offers features like data compression, query folding, and aggregations to handle large datasets
efficiently and improve performance.
Yes, Power BI allows you to define custom color themes by modifying the default color palette or by
importing themes created by others.
Performance in Power BI can be optimized by minimizing data model complexity, leveraging query folding
and data compression techniques, and using appropriate visuals and filters.
Yes, Power BI reports can be embedded into other applications, websites, or portals using the Power BI
Embedded service or APIs.
AVERAGEX ISERROR
Data security in Power BI can be managed through row-level security, user roles, and using appropriate
security measures when connecting to data sources.
To create a KPI, you can use the "Modeling" tab in Power BI Desktop and choose "New KPI" from the
"Calculations" group, defining the target, actual, and thresholds.
FILTER(<table>,<filter>)
ALL Function: It can retrieve all values in a column or rows in a given table, overriding any previous filters.
ALL(<table> or <column>)
RELATED Function: This DAX function's goal is to enable you to retrieve pertinent data from tables other than
the one you're currently working in.
RELATED(<column>)
CALCULATE Function: This Function makes simple calculations of multiple variables easy. The context in
which the DAX CALCULATE function evaluates an expression has been modified by filters.
CALCULATE(<expression>,<filter1>,<filter2>)
The output of the CALENDARAUTO function is a table with a single column called "Date" and a continuous set
of dates in it. Based on information in the model, the range of dates is automatically determined.
The term "Filter Context" refers to using DAX calculations to apply filters to a set of values in columns or
tables. Both implicit and explicit filter contexts exist.
Yes, DAX does support a few different data types. The seven types are whole numbers, decimal numbers,
boolean, text, date, currency, and N/A.
Q. What Is a Pattern?
A pattern is a universally applicable fix for a frequent issue. In Microsoft Excel, patterns are frequently used
to create tables, charts, reports, dashboards, and other things.
Power Query is a Data Automation Tool, where data preparation or data transformation happens according
to requirement. Here is place where we load the raw data different types data connectivity mode...like excel,
sql, csv and many more...So it is a kind of ETL tool where first data is extracted then transformed and finally
loaded to data model...
So, data transformation like cleaning, removing error, removing duplicates, creating tables, adding columns,
combining datasets using append or merge, removing unwanted rows or columns, grouping data and many
more transformation we can do in power query.
M language is a heart of power query which helps us to use functions in support of data transformation
process... there are like 1000 M-functions available which can be categorized into Logical, Date, numbers,
Visual level Filters - If you apply visual level filter then it will filter data only in that particular visualization
only. Visual-level filters provide the most powerful filter conditions in Power BI exclusive of custom filter
conditions specified in DAX expressions.
Page Level Filters - If you apply page level filter it will filter the data in all visuals present in that particular
page. Report level Filters - If you want to apply filter in all pages of the report you will apply report level filter.
Power Pivot's programming language, DAX, contains a collection of ready-to-use data models and formulas
called DAX Patterns. Use a DAX pattern to create your Excel data model more quickly.
The date time data type is a DAX data type that the date and time function in the DAX return.
Q. How do Max and Maxa Functions In DAX Differ from One Another?
An argument to the MAX function is a column of numerical values. MAX returns a blank if the column is
empty of any numbers. The MAXA function can evaluate values that do not include a number.
Users can create calculated fields and measures in Power BI with DAX Statements. All users must be familiar
with SQL syntax before we can create DAX statements.
SUM only accepts a column name as input SUMX accepts table name and an expression.
Now this table can be virtual table or table
present in data model and here in expression
we can use column or any existing Dax
Expression.
SUM SUMX
Q. What is DAX studio in Power BI?
Data calculations are made easier with the aid of DAX Studio. DAX functions can be used in spread sheet
programs like Open Office, Excel, and Google Docs and are faster than M Formula. Power BI may also support
DAX functions.
Import Direct
Definition: Import Query mode allows to Definition: Direct Query mode allows to get
import data and table structure both into its only table structure and data will remain at
cache memory. database source end only.
It is more like offline mode with data source It is more like an online mode with data
where data is already been sync and cached source where to display or to fetch data it
into its own memory and only required needs live connectivity mode. Must require
Power BI Gateway to get latest data from On- Power BI Gateway frequently to get data
premise data sources. from On-premise data sources
Import mode is very fast compare to Direct Direct mode is slow because all data comes
Query mode because all data comes from from data source and this source can be on-
Power BI memory Cache. premises, azure data source, sql data etc.
The answer is that DAX is a case-insensitive formula language. We can choose between case-sensitive and
case-insensitive collation styles when using SQL Server Analysis Services.
When you have a row context on the table for each side of relationship, RELATED works. If the row context is
active on one side of a relationship, RELATEDTABLE will function.
In a cell of a pivot table. Slicers, filters, rows, and columns determine the filter context.
Row context is established in a row cell (calculated column) by the row itself.
In a table's area for measuring calculations. There is no context for a row or a filter.
Definition: The append query is used to Definition: Merge query is used to merge
append the data of two or more only two queries/tables into a single
queries/tables with the same structure or a query/table with a common column
different structure into a single query/single condition. Both sides of tables must have
table. common column so that using this common
column (Like a join) we merge data.
Require 90% same column structure to Requires one common column to create
append data between two tables. merge data join between two tables.
In append query from second table there is In merge query from second table, we can
no option to choose selected column options choose how many selected columns to have
to be added in as a new query. By default, all in as a new merge query.
columns are added and if extra column is
available, it will have null values.
Q. What are some important details regarding DAX use in Power BI?
DAX expressions are evaluated in an inward to outward direction. It starts from the inner Function to the
outermost one at the very last. We should formulate our DAX expressions so that the system reads them
properly.
A functional language is DAX which implies that a function is always its entire source code.
For example, it is best to use M in Power Query Editor when creating flag column values depending on the
values of other columns. We are changing the data in this instance.
A standalone companion application to Power BI is called Power BI Designer. It is a single application that
combines Power Query, Power Pivot, and Power View.
The parameters used as or within queries in the Power BI query editor are known as query parameters. In
Power BI Desktop, we can add new parameters that we can use in queries, data models, and reports. A
specific set of data values from the entire dataset are contained in query parameters.
DAX is a more straightforward language created specifically for data analysis. Database management is one
of many tasks that can be performed using the more complex language SQL.
When launching a new query, you can use the DAX function KeepFilters to retain the filters from the previous
query. You can quickly filter data between various queries thanks to this.
Types of Join Kind: Left outer join, right outer join, Full outer join, Inner join, Left anti join, right anti join.
We use these join types during data transformation in power query editor and these join types are part of
Merge query option.
It shows all data sources from which data can be ingested. Data can actually be directly ingested from any
source including files in Excel, CSV, XML, JSON, PDF, and SharePoint formats and databases such as SQL,
Access, SQL Server Analysis Services, Oracle, IBM, MySQL, and much more.
Manually (using NEW)-Relationships between tables are manually defined using primary and foreign keys.
Automatic (using AUTO DETECT) - When enabled, this automated feature of Power BI detects relationships
between tables and creates them automatically.
Q. Can you have more than one functional relationship between two tables in a Power Pivot data model?
No!!!
There can be multiple inactive relationships, but only one active relationship between two tables in a Power
Pivot data model. Dotted lines represent inactive relationships, and continuous lines represent active
relationships.
Row-level security (Manage Roles option) limits the data a user can view and has access to, and it relies on
filters. Users can define the rules and roles in Power BI Desktop and also publish them to Power BI Service to
configure row-level security.
There are 3 different views in Power BI, each of which serves another purpose:
Report View - In this view, users can add visualizations and additional report pages and publish the same on
the portal.
Data View - In this view, data shaping can be performed using Query Editor tools.
Model View - In this view, users can manage relationships between complex datasets.
On a Power BI final report page, a developer can resize a responsive slicer to various sizes and shapes, and
the data collected in the container will be rearranged to find a match. If a visual report becomes too small to
be useful, an icon representing the visual takes its place, saving space on the report page.
Power Map can display geographical visualizations. Therefore, some location data is needed—for example,
city, state, country, or latitude and longitude.
KPI is abbreviated as Key Performance Indicator. Any professional organization has teams and employees
follow the KPI protocols. The organizations set up KPIs for all the employees. These KPIs act as their targets.
These KPIs are compared to previous performance and analyze the progress.
Q. What is a Slicer?
Slicers are an integral part of a business report generated using Power BI. The functionality of a slicer can be
considered similar to that of a filter, but, unlike a filter, a Slicer can display a visual representation of all values
and users will be provided with the option to select from the available values in the slicer’s drop-down menu.
Primarily, Power BI uses two repositories to store its data: Azure Blob Storage and Azure SQL Database. Azure
Blob Storage typically stores the data that is uploaded by the users. Azure SQL Database stores all the
metadata and artifacts for the system itself.
The CALCULATE function measures the sum of a column from any table and can be modified with Filters.
Power query is an ETL Tool used to shape, clean and transform data using intuitive interfaces without having
to use coding. It helps the user to:
Import Data from wide range of sources from files, databases, big data, social media data, etc.
A new programming language is used in power query called M-Code or M-Language, also known as
“Mashup” Language. It is used in the first part of the data import process for Power BI Desktop, which is
when data is loaded into the data model and queries are run in the background using M. When importing
data, M query is frequently used to query data sources, clean and load the data, and build custom columns.
Power BI Q&A is a language tool that helps with data querying and obtaining the required results. Q&A
renders your questions and reveals a restated query about what it requires from your data.
To show percentage in Power BI, we can create a calculated measure/calculated column using DAX
calculation & show it in the report visual depending on the requirement of the dataset being analyzed.
Syntax: This is how the formula is written—that is, the elements that comprise it.
The Syntax includes functions such as SUM (used when you want to add figures). If the Syntax isn't
correct, you'll get an error message.
Functions: These are formulas that use specific values (also known as arguments) in a particular order to
perform a calculation, similar to the functions in Excel. The categories of functions are date/time, time
intelligence, information, logical, mathematical, statistical, text, parent/child, and others.
Context: There are two types: Row context and filter context.
Row context comes into play whenever a formula has a function that applies filters to identify a
single row in a table. When one or more filters are applied in a calculation that determines a result or
value, the filter context comes into play.