This document is a tutorial on using Power BI, covering various aspects of data modeling and visualization. It extensively explains the creation and use of calculated columns and measures (DAX), demonstrates the implementation of different visualizations (tables, matrices, bar charts), and explores advanced features like calculation groups, visual level formatting, and field parameters. The tutorial also details data manipulation techniques within Power Query, including data transformations and aggregations. Finally, it guides users through publishing reports to the Power BI service for sharing.
Power BI Visuals and DAX Study Guide
Quiz
Instructions: Answer each question in 2-3 sentences.
- What is the difference between “drill down” and “expand” in the context of a Matrix visual?
- What is a “stepped layout” in a Matrix visual and how can you disable it?
- How can you switch the placement of measures between rows and columns in a Matrix visual?
- When using a Matrix visual with multiple row fields, how do you control subtotal visibility at different levels?
- What is the primary difference between a pie chart and a tree map visual in Power BI?
- How can you add additional information to a tooltip in a pie chart or treemap visual?
- What is a key difference between the display options when using “Category” versus “Details” in a treemap?
- What is the significance of the “Switch values on row group” option?
- In a scatter plot visual, what is the purpose of the “Size” field?
- How does the Azure Map visual differ from standard Power BI map visuals, and what are some of its advanced features?
Answer Key
- “Drill down” navigates to the next level of the hierarchy, while “expand” displays all levels simultaneously. Drill down goes one level at a time, while expand shows all levels at once. Drill down changes the current view while expand adds to it.
- A “stepped layout” creates an indented hierarchical view in the Matrix visual’s row headers. It can be disabled in the “Row headers” section of the visual’s format pane by toggling the “Stepped layout” option off.
- In the values section, scroll down to “switch values on row group”. You can switch the placement of measures between rows and columns by enabling or disabling the “Switch values on row group” option. When enabled, measures are displayed on rows; when disabled, they’re on columns.
- Subtotal visibility is controlled under the “Row subtotals” section of the formatting pane where you can choose to display subtotals for individual row levels, or disable them entirely; the “per row level” setting is what controls which subtotals are visible in the matrix. You can also choose to change where the subtotal name appears.
- Pie charts show proportions of a whole using slices and a legend, whereas tree maps use nested rectangles to show hierarchical data, and do not explicitly show a percentage. Pie charts show percentages while treemaps show the magnitude of a total. Tree maps do not use legends.
- You can add additional information to a tooltip by dragging measures or other fields into the “Tooltips” section of the visual’s field pane. The tooltips section allows for multiple values. Tooltips can also be switched on and off.
- When you add a field to the “Category”, it acts as a primary grouping that is displayed and colored. When you add a field to the “Details” it is displayed within the existing category and the conditional formatting disappears.
- “Switch values on row group” is an option in a Matrix visual that toggles whether measures appear in the row headers or in the column headers allowing for a KPI style or pivo style display. By default, values appear in the columns, but when switched on, they appear in the rows.
- In a scatter plot visual, the “Size” field is used to represent a third dimension, where larger values are represented by bigger bubbles. The field’s magnitude is visually represented by the size of the bubbles.
- The Azure Map visual offers more advanced map styles (e.g., road, hybrid, satellite), auto-zoom controls, and other features. It allows for heatmaps, conditional formatting on bubbles, and cluster bubbles for detailed geographic analysis, unlike standard Power BI maps.
Essay Questions
Instructions: Respond to the following questions in essay format.
- Compare and contrast the use of Matrix, Pie, and Treemap visuals, discussing their best use cases and how each represents data differently.
- Discuss the various formatting options available for labels and values across different visuals. How can these formatting options be used effectively to improve data visualization and analysis?
- Describe how the different components of the Power BI Matrix visual (e.g., row headers, column headers, sub totals, drill down, drill up) can be used to explore data hierarchies and gain insights.
- Explain how the “Values” section and “Format” pane interact to create a specific visual output, focusing on the use of different measure types (e.g., aggregation vs. calculated measures).
- Analyze the differences and best use cases for area and stacked area charts, focusing on how they represent changes over time or categories, and how they can be styled to communicate data effectively.
Glossary
- Matrix Visual: A table-like visual that displays data in a grid format, often used for displaying hierarchical data.
- Drill Down/Up: Actions that allow users to navigate through hierarchical data, moving down to more granular levels or up to higher levels.
- Expand/Collapse: Actions to show or hide sub-levels within a hierarchical structure.
- Stepped Layout: An indented layout for row headers in a Matrix visual, visually representing hierarchy.
- Measures on Rows/Columns: Option in the Matrix visual to toggle the placement of measures between row or column headers.
- Switch Values on Row Group: An option that changes where measures are displayed (on row or column headers).
- Subtotals: Sum or average aggregations calculated at different levels of hierarchy within a Matrix visual.
- Pie Chart: A circular chart divided into slices to show proportions of a whole.
- Treemap Visual: A visual that uses nested rectangles to display hierarchical data, where the size of the rectangles corresponds to the value of each category or subcategory.
- Category (Treemap): The main grouping used in a treemap, often with distinct colors.
- Details (Treemap): A finer level of categorization that subdivides the main categories into smaller units.
- Tooltip: Additional information that appears when a user hovers over an element in a visual.
- Legend: A visual key that explains the color coding used in a chart.
- Conditional Formatting: Automatically changing the appearance of visual elements based on predefined conditions or rules.
- Scatter Plot: A chart that displays data points on a two-dimensional graph, where each point represents the values of two variables.
- Size Field (Scatter Plot): A field that controls the size of the data points on a scatter plot, representing a third variable.
- Azure Map Visual: An enhanced map visual that offers more advanced styles, heatmaps, and other geographic analysis tools.
- Card Visual: A visual that displays a single value, often a key performance indicator (KPI).
- DAX (Data Analysis Expressions): A formula language used in Power BI for calculations and data manipulation.
- Visual Calculation: A calculation that is performed within the scope of a visual, rather than being defined as a measure.
- Element Level Formatting: Formatting applied to individual parts of a visual (e.g., individual bars in a bar chart).
- Global Format: A default or general formatting style that applies across multiple elements or objects.
- Model Level Formatting: Formatting rules applied at the data model level that can be used as a default for all visuals.
- Summarize Columns: A DAX function that groups data and creates a new table with the aggregated results.
- Row Function: A DAX function that creates a table with a single row and specified columns.
- IF Statement (DAX): A conditional statement that allows different calculations based on whether a logical test is true or false.
- Switch Statement (DAX): A conditional statement similar to “case” that can handle multiple conditions or multiple values.
- Mod Function: A DAX mathematical function that provides a remainder of a division.
- AverageX: A DAX function that calculates the average value across a table or a column.
- Values: A DAX function that returns the distinct values from a specified column.
- Calculate: A DAX function that modifies the filter context of a calculation.
- Include Level of Detail: A technique for incorporating more granular data into calculations without affecting other visual elements.
- Remove Level of Detail: A technique that excludes a specified level of data from a calculation for aggregated analysis.
- Filter Context: The set of filters that are applied to a calculation based on the current visual context.
- Distinct Count: A function that counts the number of unique values in a column.
- Percentage of Total: A way to display values as a proportion of a total, useful for understanding the relative contribution of various items.
- All Function: A DAX function that removes filter context from specified tables or columns.
- Allselected Function: A DAX function that removes filters based on what is not selected on a slicer, but retains filters based on what is selected on a slicer.
- RankX Function: A DAX function to calculate ranks based on an expression.
- Rank Function: A DAX function that assigns a rank to each row based on a specified column or major.
- Top N Function: A DAX function to select the top n rows based on a given value.
- Keep Filters: A function that allows the visual filters to be retained or included during DAX calculations.
- Selected Value: A DAX function used to return the value currently selected in a slicer.
- Date Add: A DAX function that shifts the date forward or backward by a specified number of intervals (days, months, quarters, years).
- EndOfMonth (EOMonth): A DAX function that returns the last day of the month for a specified date.
- PreviousMonth: A DAX function that returns the date for the previous month.
- DateMTD: A DAX function that returns the total value for the current month till date.
- TotalMTD: A DAX function that returns a total for month till date, and can be used without a calculate.
- DatesYTD: A DAX function to calculate a year to date value, and can be used in combination with a fiscal year ending parameter.
- IsInScope: A DAX function to determine the level of hierarchy for calculations.
- Offset Function: A DAX function to access values in another row based on a relative position.
- Window Function: A family of DAX functions similar to window functions of SQL but with different objectives, that can be used to calculate totals that are based on previous or next rows or columns in a visual.
- Index Function: A DAX function to find the data at a specified index from a table or a visual.
- Row Number Function: A DAX function that provides a continuous sequence of numbers.
Power BI Visuals and DAX Deep Dive
Okay, here’s a detailed briefing document summarizing the main themes and ideas from the provided “01.pdf” excerpts.
Briefing Document: Power BI Visual Deep Dive
Document Overview:
This document summarizes key concepts and features related to various Power BI visuals, as described in the provided transcript. The focus is on the functionality and customization options available for Matrix, Pie/Donut, TreeMap, Area, Scatter, Map, and Card visuals, along with a detailed exploration of DAX (Data Analysis Expressions) including its use in calculated columns and measures and some of the time intelligence functions.
Main Themes and Key Ideas:
- Matrix Visual Flexibility:
- Hierarchical Data Exploration: The Matrix visual allows for drilling down and expanding hierarchical data. The “Next Level” feature takes you to the next available level, while “Expand” allows viewing of all levels simultaneously.
- “…the next level take us to the next level means it’s take us to the next available level…”
- Stabbed vs. Non-Stabbed Layout: Offers two layouts for rows: “stabbed” (hierarchical indentation) and “non-stabbed” (flat).
- “this display is known as stabbed layout…if you switch it off the stepped layout if you switch it off then it will give you this kind of look and feel so this is non sted layout…”
- Values on Rows or Columns: Measures can be switched to display on rows instead of columns, offering KPI-like views.
- “I have this option switch values on row group rather than columns if you this is right now off if you switch it on you start seeing your measures on the row…”
- Complex Structures: Allows for the creation of complex multi-level structures using rows and columns, with drill-down options for both.
- “I can create really complex structure using the Matrix visual…”
- Total Control: Subtotals can be customized for each level of the hierarchy, with options to disable, rename, and position them.
- “In this manner you can control not only you can control let’s say you want to have the sub totals you can give the sub total some name…”
- Pie/Donut Visual Customization:
- Detailed Labels and Slices: The visual provides options for detailed labels and custom colors for each slice.
- “for each slices you have the color again the P visual use Legend…”
- Rotation: The starting point of the pie chart can be rotated.
- “now rotation is basically if you see right now it’s starting from this position…the position starting position is changing…”
- Donut Option: The pie chart can be converted to a donut chart, offering similar properties.
- “and finally you can also have a donut instead of this one…”
- Tooltip Customization: Additional fields and values can be added to the tooltip.
- “if you want to add something additional on the tool tip let’s say margin percentage you can add it…”
- Workaround for Conditional Formatting: While direct conditional formatting isn’t supported, workarounds exist.
- TreeMap Visual Characteristics:
- Horizontal Pie Alternative: The TreeMap is presented as a horizontal pie chart, showing area proportion.
- Category, Details, and Values: Uses categories, details, and values, unlike the pie chart’s legend concept.
- Conditional Formatting Limitation: Conditional formatting is not directly available when using details; colors can be applied to category levels or using conditional formatting rules.
- “once I add the category on the details now you can see the FX option is no more available for you to do the conditional formatting…”
- Tooltips and Legends: Allows the addition of tooltips and enables the display of legends.
- “again if you want to have additional information on tool tip you can add it on the tool tip then we have size title Legends as usual…”
- Area and Stacked Area Visuals:
- Trend Visualization: These visuals are useful for visualizing trends over time.
- Continuous vs. Categorical Axis: The x-axis can be set to continuous or categorical options.
- “because I’m using the date Fe field I am getting the access as continuous option I can also choose for a categorical option where I get the categorical values…”
- Legend and Transparency: Legends can be customized, and fill transparency can be adjusted.
- “if there is a shade transparency you want to control you can do that we can little bit control it like this or little bit lighter you can increase the transparency or you can decrease the transparency…”
- Conditional Formatting: While conditional formatting on series is limited at visual level, it is mentioned to be available with the work around.
- Scatter Visual Features:
- Measure-Based Axes: Best created with measures on both X and Y axes.
- “the best way to create a scatter visual is having both x-axis and y axis as a measure…”
- Dot Chart Alternative: Can serve as a dot chart when one axis is a category and another is a measure.
- “This kind of become a DOT chart…”
- Bubble Sizes: Can use another measure to control the size of the bubbles.
- Conditional Formatting for Markers: Offers options for conditional formatting of bubble colors using measures.
- “you can also have the conditional formatting done on these Bubbles and for that you have the option available under markers only if you go to the marker color you can see the f sign here it means I can use a measure out here…”
- Series and Legends: Can use a category field for series and supports legends.
- Map Visual Capabilities:
- Location Data: The map visual takes location data, enabling geographical visualization.
- “let me try to add it again it give me a disclaimer Also let’s try to add some location to it…”
- Multiple Styles: Supports various map styles including road, hybrid, satellite, and grayscale.
- Auto Zoom and Controls: Includes auto-zoom and zoom controls.
- “you have view auto zoom o on and you can have different options if you want to disable the auto zoom like you know you can observe the difference…”
- Layer Settings: Offers settings for bubble layers, heatmaps, and legends.
- “then you have the layer settings which is minimum and maximum unselected disappear you can have Legends in case we are not using Legends as of now here…”
- Conditional Formatting and Cluster Bubbles: Supports conditional formatting based on gradients, rules, or fields and has options for cluster bubbles.
- “color you have the conditional formatting option we have conditional formatting options and we can do conditional formatting based on gradient color rule based or field value base…”
- Enhanced Functionality: The Azure Map visual is presented as a strong option with ongoing enhancements.
- “map visual is coming as an stronger option compared to all other visuals and you’re getting a lot of enhancement on that…”
- Card Visual Basics:
- Single Measure Display: The Card visual is used to display a single numerical measure.
- “you can have one major only at a time…”
- Customizable Formatting: Offers customization for size, position, padding, background, borders, shadow, and label formatting.
- DAX and Formatting:
- DAX Definition: DAX (Data Analysis Expressions) is a formula language used in Power BI for advanced calculations and queries.
- “Dex is data analysis expression is a Formula expression language used in analysis services powerbi and power power in Excel…”
- Formatting Levels: Formatting can be applied at the model, visual, and element level, allowing for detailed control over presentation.
- “you will see at the model level we don’t have any decimal places and if you go to the tool tip of the second bar visual you don’t see any tool tip on the table visual you see the visual level format with one decimal place on the first bar visual you see on the data label the two decimal places means the element level formatting and in the tool tip you see the visual level formatting…”
- Visual Calculations: Visual level calculations in Power BI provide context based calculated fields.
- Measure Definitions: Measures can be defined using the DAX syntax, specifying table, measure names, and expressions. * “we first we say Define mejor the table and the mejor name the new major name or the major name which you want and the definition the expression basically…”
- Summarize Columns: SUMMARIZECOLUMNS function allows grouping of data, filtering and defining aggregated expressions.
- “if you remember when we came initially here we have been given a function which was summarize columns…”
- Row Function: Row function helps in creating one row with multiple columns and measures.
- “row function can actually take a name expression name expression name expression and it only gives me one row summarize column is even more powerful it can have a group buse also we have not added the group by there…”
- Common Aggregation Functions: Functions like SUM, MIN, MAX, COUNT, and DISTINCTCOUNT are used for data aggregation.
- “we have something known as sum you already know this same way as sum we have min max count count majors are there…”
- Conditional Logic (IF & SWITCH):
- IF Statements: Used for conditional logic, testing for a condition and returning different values for true/false outcomes.
- “if what is my condition if category because I’m creating a column I can simply use the column name belongs to the table without using the table name but ideal situation is use table name column in…”
- SWITCH Statements: An alternative to complex nested IF statements, handling multiple conditions, particularly for categorical or variable values.
- “here what is going to happen is I’m will use switch now the switch I can have expression expression can be true then I have value result value result combination but it can also be a column or a measure…”
- SWITCH TRUE Variant: Used when multiple conditions need to be tested where the conditions are not the distinct values of a column.
- Level of Detail (LOD) Expressions:
- AVERAGEX and SUMMARIZE: Functions such as AVERAGEX and SUMMARIZE are used to compute aggregates at a specified level of detail.
- “average X I can use values or summarize let me use values as of now to begin with values then let’s use geography City till this level you have to do whatever aggregation I’m going to do in the expression net…”
- Calculations inside Expression: When doing aggregations inside AVERAGEX, CALCULATE is required to ensure correct results.
- “if you are giving a table expression table expression and you are using aggregation on the column then you have to use calculate in the expression you cannot do it without that…”
- Values vs. Summarize: VALUES returns distinct column values, while SUMMARIZE enables grouping and calculation of aggregates for multiple columns and measures in addition to group bys.
- “summarize can also include a calculation inside the table so we have the Group by columns and after that the expression says that you can have name and expression here…”
- Handling Filter Context:
- Context Issues with Grand Totals: Direct use of measures in aggregated visuals can cause incorrect grand totals due to filter context.
- “and this is what we call the calculations error because of filter context context have you used…”
- Correcting Grand Totals: CALCULATE with functions like ALL or ALLSELECTED can correct grand total issues.
- “the moment we added the calculate the results have started coming out so as you aware that when you use calculate is going to appear…”
- Include vs Exclude: You can either include a specific dimension and exclude other or you can simply remove a particular dimension context for your calculation.
- Distinct Counts and Percentages:
- DISTINCTCOUNT Function: For counting unique values in a column.
- “we use the function distinct count sales item id let me bring it here this is 55…”
- Alternative for Distinct: COUNTROWS(VALUES()) can provide equivalent distinct counts for a single column and the combination of columns and measure can be taken from summarize.
- “count rows values now single column I can use values we have learned that in the past get the distinct values you can use values…”
- Percentage of Total: DIVIDE function can be used to calculate percentages, handling zero division cases.
- “calculate percent of DT net grand total of net I want to use the divide function because I want to divide the current calculation by the total grand total…”
- Percentage of Subtotal: You can calculate the percentage of a subtotal by removing the context for level of detail.
- “I can use remove filters of city now there are only two levels so I can say remove filter of City geography City…”
- Ranking and Top N:
- RANKX Function: Used to assign ranks to rows based on the major and in DAX but has limitations.
- “let me use this week start date column and create a rank so I’ll use I’ll give the name as Peak rank make it a little bit bigger so that you can see it Rank and you can see rank. EQ rank X and rank three functions are there I’m going to use rank X…”
- RANK Function: Alternative to RANKX, allows ranking by a column, handles ties, and can be used in measures.
- “ties first thing it ask for ties second thing it ask for relation which is something which I all or all selected item brand order by what order by you want to give blanks in case you have blanks Partition by in case you want to partition the rank within something match buy and reset…”
- TOPN Function: Returns a table with the top N values based on a measure.
- “the function is top n Now what is my n value n value is 10 so I need n value I need table expression and here table expression will be all or all selected order by expression order ascending or descending and this kind of information is…”
- Dynamic Top N: Achieved with modeling parameters.
- “we have new parameters one of them is a numeric range and another one is field parameter now field parameter is we’re going to discuss after some time numeric parameter was previously also known as what if parameter…”
- Time Intelligence:
- Date Table Importance: A well-defined date table is crucial for time intelligence calculations.
- “so the first thing we want to make sure there is a date table…without a date table or a continuous set of dates this kind of calculation will not work…”
- Date Range Creation: DAX functions enable the creation of continuous date ranges for various periods, such as month, quarter, and year start/end dates.
- “and now we use year function month function and year month function so what will happen if I pass a date to that it will return me the month of that date and I need number so what I need is month function is going to give me the number isn’t it…”
- Total MTD Function: Calculates Month-to-Date value.
- “I’m going to use total MTD total MTD requires an expression date and filter it can have a filter and if you need more than one filter then you can again use calculate on top of total MTD otherwise total MTD doesn’t require calcul…”
- Dates MTD Function: Also calculates MTD, and requires CALCULATE.
- “this time I’ve clicked on a major so Major Tool is open as of now I’ll click on new measure calculate net dates MTD dates MTD required date…”
- YTD: Calculates Year-to-Date values using DATESYTD (with and without fiscal year end).
- “let me calculate total YTD and that’s going to give me YTD let me bring in the YTD using dates YTD so net YTD net 1 equal to calculate net dates YTD and dates YTD required dates and year and date…”
- Previous Month Calculations: DATEADD to move dates backward and PREVIOUSMONTH for last month data.
- “but inside the dates MDD I want the entire dates to move a month back I’m going to use a function date add and please remember the understanding of date head that date head also require continuous for dates…”
- Offset: Is a better option to get the Previous value or any offset required.
- “calculate net offset I need function offset what it is asking it is asking for relation what is my relation all selected date and I need offset how many offset minus one how do we go to minus one date…”
- Is In Scope: A very powerful DAX function, which can be used in place of multiple IF statements and allows the handling of Grand totals in a measure.
- “if I’m in the month is there month is in scope I need this formula what happens if I’m in the year is ear is in the scope or if I’m in a grand total you can also have this is in scope grand total but here is in scope is really important…”
- Window Functions
- Window: A DAX function which is very similar to SQL Window function and helps in calculating running total, rolling total and other cumulative calculations.
- “the first is very simple if mod mod is a function which gives me remainder so it takes a number Division and gives the remainder so we are learning a mathematical function mod here…”
- Index: A function which allows to find top and bottom performer based on certain calculation in the visual.
- “I’m going to use the function which is known as index index which position first thing is position then relation order by blanks Partition by if you need the within let’s say within brand what is the top category or within the year which is the top month match by I need the topper one…”
- Rank: A DAX function very similar to rank X but has additional flexibility in terms of columns and measures.
- “what I need ties then something is repeat use dance relation is really important here and I’m going to create this relation using summarize all selected sales because the things are coming from two different table customer which is a dimension to the sales and the sales date which is coming from the sales that is why I need and I need definitely the all selected or the all data and that’s that is why I’m using all selected on the sales inside the sumarize from customer what I need I need name…”
- Row Number: A very useful function which helps in creating sequential number or in a partitioned manner.
- “I will bring item name from the item table and I would like to bring from the sales table the sales State Sal State and now I would like to bring one major NE now here I want to create a row number what would be row number based on row number can be based on any of my condition…”
- Visual Calculations:
- Context-Based Calculations: Visual calculations perform calculation based on the visual contexts using the DAX.
- “I’m going to use the function offset what it is asking it is asking for relation what is my relation all selected date and I need offset how many offset minus one how do we go to minus one date…”
- Reset Option: The reset option in offset can be used to get the calculation work as needed.
- “and as you can see inside the brand 10 it is not getting the value for for the first category and to make it easier to understand let me first remove the subtotals so let me hide the subtotals…”
- RANK with Reset: Enables ranking within partitions.
- “and as you can see the categories are ranked properly inside each brand so there is a reset happening for each brand and categories are ranked inside that…”
- Implicit Measure: You can also use the visual implicit measures in the visual calculation.
- “in this row number function I’m going to use the relation which is row next thing is order by and in this order by I’m going to use the something which is we have in this visual sum of quantity see I’m not created a measure here I’m going to use sum of quantity in this visual calculation…”
Conclusion:
The provided material covers a wide array of features and capabilities within Power BI. The document highlights the importance of understanding both the visual options and the underlying DAX language for effective data analysis and presentation. The exploration of time intelligence functions and new DAX functions further empowers users to create sophisticated and actionable reports. This is a good start to get the deep knowledge of Power BI visuals.
Power BI Visuals and DAX: A Comprehensive Guide
Frequently Asked Questions on Power BI Visuals and DAX
- What is the difference between “drill down,” “drill up,” and “expand” options in a Matrix visual?
- Drill down moves to the next level of a hierarchy, while drill up returns to a higher level. Expand adds the next level without changing your current view and can be used multiple times for multiple levels, while “next level” only takes you to the next available level and does not require multiple clicks.
- What is the difference between a “stepped layout” and a non-stepped layout in Matrix visuals? A stepped layout displays hierarchical data with indentation, showing how values relate to each other within a hierarchy. Non-stepped layout will display all levels without indentation and in a more tabular fashion.
- How can I control subtotal and grand total displays in a Matrix visual?
- In the format pane under “Row sub totals,” you can enable/disable sub totals for all levels, individual row levels, and grand totals. You can also choose which level of sub totals to display, add custom labels, and position them at the top or bottom of their respective sections. Subtotals at each level are controlled by the highest level in the row hierarchy at that point.
- What customization options are available for Pie and Donut visuals?
- For both Pie and Donut visuals, you can adjust the colors of slices, add detail labels with percentage values, rotate the visual, control label sizes and placement, use a background, and add tooltips. Donut visuals can also be used with a transparent center to display a value in a card visual in the middle. Additionally, with a Pie chart, you have the additional option to have a legend with a title and placement options, which the Donut chart does not have.
- How does the Treemap visual differ from the Pie and Donut visuals, and what customization options does it offer? The Treemap visual uses rectangles to represent hierarchical data; it does not show percentages directly, and unlike Pie, there is no legend. Instead, you have category, details, and values. You can add data labels, and additional details as tool tips, can adjust font, label position and can add background and control its transparency. Conditional formatting is only available on single category levels.
- What are the key differences between Area and Stacked Area visuals, and how are they formatted? Area charts visualize trends using a continuous area, while Stacked Area charts show the trends of multiple series which are stacked on top of one another. Both visuals share similar formatting options, including x-axis and y-axis customization, title and legend adjustments, reference lines, shade transparency, and the ability to switch between continuous and categorical axis types based on your dataset. These features are similar across a wide range of visualizations. You can use multiple measures on the y-axis or a legend on the x-axis to create an area visual and you can use both measure and legend in case of stacked area visual.
- What are the key components and customization options for the Scatter visual?
The Scatter visual plots data points based on X and Y axis values, usually measures. You can add a size variable to create bubbles and use different marker shapes or conditional formatting to color the markers. You can also add a play axis, tool tips, and legend for more interactive visualizations. You cannot add dimension to the y-axis. You can add dimension on the color or the size, but not on the y-axis.
- How do you use DAX to create calculated columns and measures, and what are the differences between them?
- DAX (Data Analysis Expressions) is a language used in Power BI for calculations and queries in tabular data models. Calculated columns add new columns to a table based on DAX expressions. Measures are dynamic calculations based on aggregations and calculations, responding to filters and slicers. Measures do not add column to the table. Both use the same formula language, but columns are fixed for each row and measures are evaluated when used. DAX calculations can be created in measure definition as well as in the query view where you are able to see your results in tabular format and using those, you can create measures in the model view.
Mastering Power BI: A Comprehensive Guide
Power BI is a business intelligence and analytics service that provides insights through data analysis [1]. It is a collection of software services, apps, and connectors that work together to transform unrelated data sources into coherent, visually immersive, and interactive insights [1].
Key aspects of Power BI include:
- Data Visualization: Power BI enables sharing of insights through data visualizations, which can be incorporated into reports and dashboards [1].
- Scalability and Governance: It is designed to scale across organizations and has built-in governance and security features, allowing businesses to focus on data usage rather than management [1].
- Data Analytics: This involves examining and analyzing data sets to draw insights, conclusions, and make data-driven decisions. Statistical and analytical techniques are used to interpret relevant information from data [1].
- Business Intelligence: This refers to the technology, applications, and practices for collecting, integrating, analyzing, and presenting business information to support better decision-making [1]. Power BI can collect data from various sources, integrate them, analyze them, and present the results [1].
The journey of using Power BI and other business intelligence analytics tools starts with data sources [2]. Common sources include:
- External sources such as Excel and databases [2].
- Data can be imported into Power BI Desktop [2].
- Import Mode: The data resides within Power BI [2].
- Direct Query: A connection is created, but the data is not imported [2].
- Power BI reports are created on the desktop using Power Query for data transformation, DAX for calculations, and visualizations [2].
- Reports can be published to the Power BI service, an ecosystem for sharing and collaboration [2].
- On-premises data sources require an on-premises gateway for data refresh [2]. Cloud sources do not need an on-premises gateway [2].
- Published reports are divided into two parts: a dataset (or semantic model) and a report [2].
- The dataset can act as a source for other reports [2].
- Live connections can be created to reuse datasets [2].
Components of Power BI Desktop
- Power Query: Used for data preparation, cleaning, and transformation [2].
- The online version is known as data flow, available in two versions: Gen 1 and Gen 2 [2].
- DAX: Used for creating complex measures and calculations [2].
- Direct Lake: A new connection type in Microsoft Fabric that merges import and direct query [2].
Power BI Desktop Interface
- The ribbon at the top contains menus for file, home, insert, modeling, view, optimize, help, and external tools [3].
- The Home tab includes options to get data, transform data (Power Query), and modify data source settings [3].
- The Insert tab provides visualization options [3].
- The Modeling tab allows for relationship management, creating measures, columns, tables, and parameters [3].
- The View tab includes options for themes, page views, mobile layouts, and enabling/disabling panes [3].
Power BI Service
- Power BI Service is the ecosystem where reports are shared and collaborated on [2].
- It requires a Pro license to create a workspace and share content [4].
- Workspaces are containers for reports, paginated reports, dashboards, and datasets [4].
- The service allows for data refresh scheduling, with Pro licenses allowing 8 refreshes per day and Premium licenses allowing 48 [2].
- The service also provides for creation of apps for sharing content [4].
- The service has a number of settings that can be configured by the admin, such as tenant settings, permissions, and data connections [4, 5].
Data Transformation with Power Query
- Power Query is a data transformation and preparation engine [6].
- It uses the “M” language for data transformation [6].
- It uses a graphical interface with ribbons, menus, buttons, and interactive components to perform operations [6].
- Power Query is available in Power BI Desktop, Power BI online, and other Microsoft products and services [6].
- Common operations include connecting to data sources, extracting data, transforming data, and loading it into a model [6].
DAX (Data Analysis Expressions)
- DAX is used for creating measures, calculated columns, and calculated tables [7].
- It can be used in the Power BI Desktop and Power BI service [7].
- The DAX query view allows for writing and executing DAX queries, similar to a SQL editor [7].
- The query view has formatting options, commenting, and find/replace [7].
- DAX query results must return a table [7].
Visuals
- Power BI offers a range of visuals, including tables, slicers, charts, and combo visuals [8-10].
- Text slicers allow for filtering data based on text input [10].
- They can be used to create dependent slicers where other slicers are filtered by the text input [10].
- Sync slicers allow for synchronizing slicers across different fields, even if the fields are in different tables [9].
- Combo visuals combine charts, such as bar charts and line charts [9].
- Conditional formatting can be applied to visuals based on DAX expressions [7].
Key Concepts
- Data Quality: High-quality data is necessary for quality analysis [1].
- Star Schema: Power BI models typically use a star schema with fact and dimension tables [11].
- Semantic Model: A data model with relationships, measures, and calculations [2].
- Import Mode: Data is loaded into Power BI [12].
- Direct Query: Data is not imported; queries are sent to the source [12].
- Live Connection: A connection to a semantic model, where the model is not owned by Power BI [12].
- Direct Lake: Connection type that leverages Microsoft Fabric data lake [12].
These concepts and features help users analyze data and gain insights using Power BI.
Data Manipulation in Power BI Using Power Query and M
Data manipulation in Power BI primarily involves using Power Query for data transformation and preparation [1-3]. Power Query is a data transformation and data preparation engine that helps to manipulate data, clean data, and put it into a format that Power BI can easily understand [2]. It is a graphical user interface with menus, ribbons, buttons, and interactive components, making it easy to apply transformations [2]. The transformations are also tracked, with every step recorded [3]. Behind the scenes, Power Query uses a scripting language known as “M” language for all transformations [2].
Here are key aspects of data manipulation in Power BI:
- Data Loading:Data can be loaded from various sources, such as Excel files, CSVs, and databases [4, 5].
- When loading data, users can choose between “load data” (if the data is ready) or “transform data” to perform transformations before loading [5].
- Data can be loaded via import mode, where the data resides within Power BI, or direct query, where a connection is created, but data is not imported [1, 5]. There is also Direct Lake, a new mode that combines the best of import and direct query for Microsoft Fabric lake houses and warehouses [1].
- Power Query Editor:The Power Query Editor is the primary interface for performing data transformations [2].
- It can be accessed by clicking “Transform Data” in Power BI Desktop [3].
- The editor provides a user-friendly set of ribbons, menus, buttons and other interactive components for data manipulation [2].
- The Power Query editor is also available in Power BI online, Microsoft Fabric data flow Gen2, Microsoft Power Platform data flows, and Azure data factory [2].
- Data Transformation Steps:Power Query captures every transformation step, allowing users to track and revert changes [3].
- Common transformations include:
- Renaming columns and tables [3, 6].
- Changing data types [3].
- Filtering rows [7].
- Removing duplicates [3, 8].
- Splitting columns by delimiter or number of characters [9].
- Grouping rows [9].
- Pivoting and unpivoting columns [3, 10].
- Merging and appending queries [8].
- Creating custom columns using formulas [8, 9].
- Column Operations:Power Query allows for examining column properties, such as data quality, distribution, and profiles [3].
- Column Quality shows valid, error, and empty values [3].
- Column Distribution shows the count of distinct and unique values [3].
- Column Profile shows statistics such as count, error, empty, distinct, unique, min, max, average, standard deviation, odd, and even values [3].
- Users can add custom columns with formulas or duplicate existing columns [8].
- M Language:Power Query uses the M language for all data transformations [2].
- M is a case-sensitive language [11].
- M code can be viewed and modified in the Advanced Editor [2].
- M code consists of let statements for variables and steps, expressions for transformation, and in statement to output a query formula step [11].
- Star Schema Creation:Power Query can be used to transform single tables into a star schema by creating multiple dimension tables and a fact table [12].
- This involves duplicating tables, removing unnecessary columns, and removing duplicate rows [12].
- Referencing tables is preferable to duplicating them because it only loads data once [12].
- Cross Joins:Power Query does not have a direct cross join function, but it can be achieved using custom columns to bring one table into another, creating a cartesian product [11].
- Rank and Index:Power Query allows for adding index columns for unique row identification [9].
- It also allows for ranking data within groups using custom M code [13].
- Data Quality:Power Query provides tools to identify and resolve data quality issues, which is important for getting quality data for analysis [3, 12].
- Performance:When creating a data model with multiple tables using Power Query, it is best to apply changes periodically, rather than all at once, to prevent it from taking too much time to load at the end [10].
By using Power Query and the M language, users can manipulate and transform data in Power BI to create accurate and reliable data models [2, 3].
Power BI Visualizations: A Comprehensive Guide
Power BI offers a variety of visualizations to represent data and insights, which can be incorporated into reports and dashboards [1]. These visualizations help users understand data patterns, trends, and relationships more effectively [1].
Key aspects of visualizations in Power BI include:
- Types of Visuals: Power BI provides a wide array of visuals, including tables, matrices, charts, maps, and more [1].
- Tables display data in a tabular format with rows and columns [1, 2]. They can include multiple sorts and allow for formatting options like size, style, background, and borders [2].
- Table visuals can have multiple sorts by using the shift button while selecting columns [2].
- Matrices are similar to tables, but they can display data in a more complex, multi-dimensional format.
- Charts include various types such as:
- Bar charts and column charts are used for comparing data across categories [3].
- Line charts are used for showing trends over time [4].
- Pie charts and donut charts display proportions of a whole [5].
- Pie charts use legends to represent categories, and slices to represent data values [5].
- Donut charts are similar to pie charts, but with a hole in the center [5].
- Area charts and stacked area charts show the magnitude of change over time [6].
- Scatter charts are used to display the relationship between two measures [6].
- Combo charts combine different chart types, like bar and line charts, to display different data sets on the same visual [3].
- Maps display geographical data [7].
- Map visuals use bubbles to represent data values [7].
- Shape map visuals use colors to represent data values [7].
- Azure maps is a powerful map visual with various styles, layers, and options [8].
- Tree maps display hierarchical data as nested rectangles [5].
- Tree maps do not display percentages like pie charts [5].
- Funnel charts display data in a funnel shape, often used to visualize sales processes [7].
- Customization: Power BI allows for extensive customization of visuals, including:
- Formatting Options: Users can modify size, style, color, transparency, borders, shadows, titles, and labels [2, 5].
- Conditional Formatting: Visuals can be conditionally formatted based on DAX expressions, enabling dynamic visualization changes based on data [4, 9]. For instance, colors of scatter plot markers can change based on the values of discount and margin percentages [9].
- Titles and Subtitles: Visuals can have titles and subtitles, which can be dynamic by using DAX measures [2].
- Interactivity: Visuals in Power BI are interactive, allowing users to:
- Filter and Highlight: Users can click on visuals to filter or highlight related data in other visuals on the same page [9].
- Edit interactions can modify how visuals interact with each other. For example, you can prevent visuals from filtering each other or specify whether the interaction is filtering or highlighting [9].
- Drill Through: Users can navigate to more detailed pages based on data selections [10].
- Drill through buttons can be used to create more interactive reports, and the destination of the button can be conditional [10].
- Tooltips: Custom tooltips can be created to provide additional information when hovering over data points [5, 10].
- Tooltip pages can contain detailed information that is displayed as a custom tooltip. These pages can be customized to pass specific filters and parameters [10].
- AI Visuals:
- Key influencers analyze which factors impact a selected outcome [11].
- Decomposition trees allow for root cause analysis by breaking down data into hierarchical categories [11].
- Q&A visuals allow users to ask questions and display relevant visualizations [11].
- Slicers: Slicers are used to filter data on a report page [9, 12].
- List Slicers: Display a list of values to choose from [12].
- Text slicers allow filtering based on text input [12].
- Sync slicers synchronize slicers across different pages and fields [3, 12].
- Card Visuals: Display single numerical values and can have formatting and reference labels [13].
- New card visuals allow for displaying multiple measures and images [13].
- Visual Calculations: Visual calculations are DAX calculations that are defined and executed directly on a visual. These calculations can refer to data within the visual, including columns, measures, and other visual calculations [14].
- Visual calculations are not stored in the model but are stored in the visual itself [14].
- These can be used for calculating running sums, moving averages, percentages, and more [14].
- They can operate on aggregated data, often leading to better performance than equivalent measures [14].
- They offer a variety of functions, such as RUNNINGSUM, MOVINGAVERAGE, PREVIOUS, NEXT, FIRST, and LAST. Many functions have optional AXIS and RESET parameters [14].
- Bookmarks: Bookmarks save the state of a report page, including visual visibility [15].
- Bookmarks can be used to create interactive reports, like a slicer panel, by showing and hiding visuals [15].
- Bookmarks can be combined with buttons to create more interactive report pages [15].
By utilizing these visualizations and customization options, users can create informative and interactive dashboards and reports in Power BI.
Power BI Calculated Columns: A Comprehensive Guide
Calculated columns in Power BI are a type of column that you add to an existing table in the model designer. These columns use DAX (Data Analysis Expressions) formulas to define their values [1].
Here’s a breakdown of calculated columns, drawing from the sources:
- Row-Level Calculations: Calculated columns perform calculations at the row level [2]. This means the formula is evaluated for each row in the table, and the result is stored in that row [1].
- For example, a calculated column to calculate a “gross amount” by multiplying “sales quantity” by “sales price” will perform this calculation for each row [2].
- Storage and Data Model: The results of calculated column calculations are stored in the data set or semantic model, becoming a permanent part of the table [1, 2].
- This means that the calculated values are computed when the data is loaded or refreshed and are then saved with the table [3].
- Impact on File Size: Because the calculated values are stored, calculated columns will increase the size of the Power BI file [2, 3].
- The file size increases as new values are added into the table [2].
- Performance Considerations:Calculated columns are computed during data load time, and this computation can impact load time [3].
- Row-level calculations can be costly if the data is large, impacting runtime [4].
- For large datasets, it may be more efficient to perform some calculations in a calculated column and then use measures for further aggregations [2].
- Creation Methods: There are multiple ways to create a new calculated column [2]:
- In Table Tools, you can select “New Column” [2, 3].
- In Column Tools, you can select “New Column” after selecting a column [2].
- You can also right-click on any table or column and choose “New Column” [2].
- Formula Bar: The formula bar is used to create the new calculated column, with the following structure [2]:
- The left side of the formula bar is where the new column is named [2].
- The right side of the formula bar is where the DAX formula is written to define the column’s value [2].
- Line numbers in the formula bar are not relevant and are added automatically [2].
- Fully Qualified Names: When writing formulas, it is recommended to use fully qualified names (i.e., table name and column name) to avoid ambiguity [2].
- Column Properties: Once a calculated column is created, you can modify its properties in the Column tools, like [2]:
- Name.
- Data type.
- Format (e.g., currency, percentage, decimal places).
- Summarization (e.g., sum, average, none).
- Data category (e.g., city, state) [3].
- Sort by column [3].
- When to Use Calculated Columns:Use when you need row-level calculations that are stored with the data [2, 4].
- Multiplication should be done at the row level and then summed up. When you have to multiply values across rows, you should use a calculated column or a measure with an iterator function like SUMX [4].
- Calculated columns are suitable when you need to perform calculations that can be pre-computed and don’t change based on user interaction or filters [3].
- When to Avoid Calculated Columns:When there is a division, the division should be done after aggregation [4]. It is generally better to first aggregate and then divide by using a measure.
- Examples:
- Calculating gross amount by multiplying sales quantity and sales price [2].
- Calculating discount amount by multiplying gross amount by discount percentage and dividing it by 100 [2].
- Calculating cost of goods sold (COGS) by multiplying sales quantity by sales cost [2].
- Limitations:Calculated columns increase the file size [3].
- Calculated columns are computed at data load time [3].
- They are not dynamic and will not change based on filters and slicers [5, 6].
- They are not suitable for aggregations [4].
In summary, calculated columns are useful for pre-calculating and storing row-level data within your Power BI model, but it’s important to be mindful of their impact on file size, load times, and to understand when to use them instead of measures.
Power BI Measures: A Comprehensive Guide
Measures in Power BI are dynamic calculation formulas that are used for data analysis and reporting [1]. They are different from calculated columns because they do not store values, but rather are calculated at runtime based on the context of the report [1, 2].
Here’s a breakdown of measures, drawing from the sources:
- Dynamic Calculations: Measures are dynamic calculations, which means that the results change depending on the context of the report [1]. The results will change based on filters, slicers, and other user interactions [1]. Measures are not stored with the data like calculated columns; instead, they are calculated when used in a visualization [2].
- Run-Time Evaluation: Unlike calculated columns, measures are evaluated at run-time [1, 2]. This means they are calculated when the report is being viewed and as the user interacts with the report [2].
- This makes them suitable for aggregations and dynamic calculations.
- No Storage of Values: Measures do not store values in the data model; they only contain the definition of the calculation [2]. Therefore, they do not increase the size of the Power BI file [3].
- Aggregation: Measures are used for aggregated level calculations which means they are used to calculate sums, averages, counts, or other aggregations of data [3, 4].
- Measures should be used for performing calculations on aggregated data [3].
- Creation: Measures are created using DAX (Data Analysis Expressions) formulas [1]. Measures can be created in the following ways:
- In the Home tab, select “New Measure” [5].
- In Table Tools, select “New Measure” after selecting a table [5].
- Right-click on a table or a column and choose “New Measure” [5].
- Formula Bar: Similar to calculated columns, the formula bar is used to define the measure, with the following structure:
- The left side of the formula bar is where the new measure is named.
- The right side of the formula bar is where the DAX formula is written to define the measure’s value.
- Naming Convention: When creating measures, a common practice is to add the word “amount” at the end of the column name so that the measure names can be simple without “amount” in the name [5].
- Types of Measures:
- Basic Aggregations: Measures can perform simple aggregations such as SUM, MIN, MAX, AVERAGE, COUNT, and DISTINCTCOUNT [6].
- SUM adds up values [7].
- MIN gives the smallest value in the column [6].
- MAX gives the largest value in the column [6].
- COUNT counts the number of values in a column [6].
- DISTINCTCOUNT counts unique values in a column [6].
- Time Intelligence Measures: Measures can use functions to perform time-related calculations like DATESMTD, DATESQTD, and DATESYTD [8].
- Division Measures: When creating a measure that includes division, it is recommended to use the DIVIDE function, which can handle cases of division by zero [7].
- Measures vs. Calculated Columns:Measures are dynamic, calculated at run-time, and do not increase file size [1, 2].
- Calculated Columns are static, computed at data load time, and increase file size [3].
- Measures are best for aggregations, and calculated columns are best for row-level calculations [3, 4].
- Formatting: Measures can be formatted using the Measure tools or the Properties pane in the data model view [7].
- Formatting includes setting the data type, number of decimal places, currency symbols, and percentage formatting [5, 7].
- Multiple measures can be formatted at once using the model view [7].
- Formatting can be set at the model level, which applies to all visuals unless overridden at the visual level [9].
- Formatting can also be set at the visual level, which overrides the model-level formatting [9].
- Additionally, formatting can be set at the element level, which overrides both the model and visual level formatting, such as data labels in a chart [9].
- Examples:Calculating the total gross amount by summing the sales gross amount [7].
- Calculating the total cost of goods sold (COGS) by summing the cogs amount [7].
- Calculating total discount amount by summing the discount amount [7].
- Calculating net amount by subtracting the discount from the gross amount [7].
- Calculating margin by subtracting cogs from the net amount [7].
- Calculating discount percentage by dividing the discount amount by the gross amount [7].
- Calculating margin percentage by dividing the margin amount by the net amount [7].
In summary, measures are used to perform dynamic calculations, aggregations, and other analytical computations based on the context of the report. They are essential for creating interactive and informative dashboards and reports [1].

By Amjad Izhar
Contact: amjad.izhar@gmail.com
https://amjadizhar.blog
Affiliate Disclosure: This blog may contain affiliate links, which means I may earn a small commission if you click on the link and make a purchase. This comes at no additional cost to you. I only recommend products or services that I believe will add value to my readers. Your support helps keep this blog running and allows me to continue providing you with quality content. Thank you for your support!

