Power BI is a Business Intelligence tool used to create Interactive Dashboards which helps the Business users to analyze their data insights. In Power BI, to show calculations measures are built, and it is used to represent the data on dashboard. Slicers in Power BI are the simple forms of filters that play a key role in designing customized charts. let’s see how we can use multiple measures in one visual using slicer selection.
Steps:
- Create your measures like total Quantity, Total sales which can be used in your switching measure calculation.
Ex:1) Total Quantity = CALCULATE (SUM (Orders [Quantity]), USERELATIONSHIP (Orders [Order Date], Calendar [Date]))
2)Total Orders = CALCULATE (DISTINCTCOUNT (Orders [Order ID]), USERELATIONSHIP (Orders [Order Date], Calendar [Date]))
- Create a table for slicer that should contain your measure names. And use this column as your slicer to display the measure in visual.
- Create a switch measure calculation which will be used in values in your visual.
Now in this calculation we are basically saying that if, Total Orders are selected in slicer then show us Total orders and if Total Quantity is selected then show Quantity.
- We can dynamically change the title of visual as per selection on slicer by using the below measure.
- Use this measure in title in formatting pane using function. For reference see below screenshot.
- Take bar chart in your canvas and place your measure in values and date in your axis and place slicer visual on your canvas and drag the column which we created from the table in which we are having the measure names.
This is how we can show multiple measures in a single visual in Power BI.
Good work.