Forum Discussion
Slicer with measures ?
Hi,
You could take this approach.
Create a table called Measures. The contents will be
MeasureName , MeasureID as column names
The rows will be
Gross Revenue , 1
Net Revenue , 2
Create a measure in the data model as follows :
Showvalue=switch (TRUE,
Min ( Measures[MeasureID] ) = 1,
( [SalesQty] ), /* replace this by your fomula for Gross Revenue or if already exists put that measurename */
Min ( Measures[MeasureID] ) = 2,
( [Sales] ) ) /* replace this by your fomula for Net Revenue or if already exists put that measurename */
Now create a slicer with Measure table column MeasureName .
In the chart or table , use the measure Showvalue as your values column to chart or display in table.
and you will have the results.
Best
Cheenusing
- padodge9 years agoNew Member
I have tried several variations of this approach with MeasureID being in one table and SalesQty being in an unrelated table (within a Tabular model). The calculated column (measure) does not fail, but the slicer on MeasureID has no affect in Power BI. Am I missing something? Is it possible to slice a value from an unrelated table?
- GayatriCH9 years agoNew Member
Hi,
I am also having an issue with slicer pointing to calcualted measure. Is there a way to create a slicer in power bi that points to calculated measure?
Thanks,
Gayatri
- Highlander9 years agoFrequent Visitor
Really helpful, works brilliantly thank you so much!
I'll look out for your other solutions.
Excellent effort!
- Highlander9 years agoFrequent Visitor
Many thanks for this excellent solution, really works so well - had seen this type of example before, but this works brilliantly..the penny has dropped!
Thanks for posting this
Kind regards
Highlander
- Highlander9 years agoFrequent Visitor
So good it deserved 2 posts.
(new to this community!_)
- sure199 years agoHelper II
hi Mr. Cheenusing,
i have an excel sheet with few columns like
Date, Name, State, Total Sales (numbers), M&S(Num), Elect(Num), Water(Num), Fuel(Num), etc.
i am not able to use slicer for M&S, Total Sales, Elec, Water, Fuel? how can i use this in the visualisation as slicer?