Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi guys,
I have in my pbi a line chart with 6 measures, but my client want to have the possibility (using an slicer) to select if he wants to see all the measures or select in the slicers what measures needs to see.
is it possible?
i have done a trial, creating an external table with the name of the measures and then trying to use the meausres with the hasonfilter and switch example
IF(HASONEFILTER(Table1[Column1]),
SWITCH(SELECTEDVALUE(Table1[Column1]),
"Expected",Values[Expected]
),
Blank()
)
but this only run when i select only one option in the slicer, if i select 2 measures this function doesnt run
can someone help me on this?
Solved! Go to Solution.
@dobregon it should be pretty straight forward, here is an example, let's you have 3 measures , YTD/QTD/MTD and a slicer table with 3 options:
MTD
QTD
YTD
so in the visual we want to show the values of selection in the slicer and if nothing is selected, all 3 will be shown (this behaviour can be changed) but let's we are going with this behaviour when nothing is selected:
Change each measure as below:
MTD Measure =
VAR __show = IF( "MTD" IN VALUES( 'Slice'[SlicerSelection] ) , 1 )
RETURN
<your existing MTD Measure calculateion> * __show
QTD Measure =
VAR __show = IF( "QTD" IN VALUES( 'Slice'[SlicerSelection] ) , 1 )
RETURN
<your existing QTD Measure calculateion> * __show
YTD Measure =
VAR __show = IF( "YTD" IN VALUES( 'Slice'[SlicerSelection] ) , 1 )
RETURN
<your existing YTD Measure calculateion> * __show
you will see measure based on the selection in the slicer. You can tweak/change as per your need.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@dobregon , Actually you have to make it blank().
This example changes the measure but you have to make it blank , in place of other measures
Thanks @amitchandak but it is what i tried. The problem is that i can select at the same time (MTD,QTD) because i will not see nothing.
This example is to select one type of measure. but in reality i have 5 measures and i want to select 1, 2, 3 or all measures to see in the chart.
@dobregon it should be pretty straight forward, here is an example, let's you have 3 measures , YTD/QTD/MTD and a slicer table with 3 options:
MTD
QTD
YTD
so in the visual we want to show the values of selection in the slicer and if nothing is selected, all 3 will be shown (this behaviour can be changed) but let's we are going with this behaviour when nothing is selected:
Change each measure as below:
MTD Measure =
VAR __show = IF( "MTD" IN VALUES( 'Slice'[SlicerSelection] ) , 1 )
RETURN
<your existing MTD Measure calculateion> * __show
QTD Measure =
VAR __show = IF( "QTD" IN VALUES( 'Slice'[SlicerSelection] ) , 1 )
RETURN
<your existing QTD Measure calculateion> * __show
YTD Measure =
VAR __show = IF( "YTD" IN VALUES( 'Slice'[SlicerSelection] ) , 1 )
RETURN
<your existing YTD Measure calculateion> * __show
you will see measure based on the selection in the slicer. You can tweak/change as per your need.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I am trying to follow along. I have a departed employee who has applied this. Problem is that i cannot seem to locate this measure in my report. Can they hide this measure?
@parry2k thanks! very simple and it runs!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |