Forum Discussion
How can I switch the measure a chart or table is using based on a slicer choice?
- 10 years ago
If you mean something like this:
Then it's all in the data model. These are the (simplified) two main tables supporting the report above:
In our case, we have three similar but separate pages (and three corresponding measure tables), because the measures have different data types (percentage, currency, and whole number).
- 10 years ago
Hi ScottG
Please refer to below link and let me know if you have any further queries.
http://www.bipatterns.com/dynamic-powerbi-reports-via-dax/
Measures on a slicer is well explained in this.
If you mean something like this:
Then it's all in the data model. These are the (simplified) two main tables supporting the report above:
In our case, we have three similar but separate pages (and three corresponding measure tables), because the measures have different data types (percentage, currency, and whole number).
So far I have been able to include the Measure Table with Measure Name as a slicer, however how does this relate back to the fact tables in this case? I.E. how does Power BI know to filter to that column or calculated measure for the fact table?
My appologies as I mentioned I am quite new to Tabular.
- anithat10 years ago
Resolver II
Hi ScottG
Please refer to below link and let me know if you have any further queries.
http://www.bipatterns.com/dynamic-powerbi-reports-via-dax/
Measures on a slicer is well explained in this.
- ScottG10 years ago
Advocate II
This looks quite clear, Thank you for the sample! I will try it out first thing tomorrow.
- Anonymous9 years agoNot applicable
This link is no longer valid. Does anyone have the example archived? Thanks!
- Ishanm9598 years agoFrequent Visitor
Suppose u have entered data into a static table with values "Measure1" and "Measure2"
[Measure1] and [Measure2] are the two measures in your fact table.
You should check in the Relationships view that the fact table and the static table(for slicer) dont have any relationship
defined on them.
Next create another Measure using DAX
Metric Selection = SWITCH(TRUE(),
VALUES('Static Table'[MeasureName]) = "Measure1",[Measure1]
VALUES('Static Table'[MeasureName]) = "Measure2",[Measure2],
BLANK())and then use the [Metric Selection] Measure in your chart and toggle between the measures using slicers.