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.
Hello,
I've implemented a "measure slicer" that works well: using the slicer, I can select one mesure.
I have a table with the values "filter1", "filter2", "filter3" that I use in a slicer.
And I use the following measure (simplified):
Graph: Slicer Cumul annuel =
IF(HASONEFILTER('KPI: Slicer'[Type]),
SWITCH(SELECTEDVALUE('KPI: Slicer'[Type]),
"filter1", [KPI1],
"filter2", [KPI2],
"filter3", [KPI3],
),
BLANK()
)
==> Now, i'd like to be able to select multiple values in the slicer, and it would sum all selected mesures.
Thank you,
Solved! Go to Solution.
@Ncio , try like
Graph: Slicer Cumul annuel =
calculate(
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter1"),'KPI: Slicer'[Type] )+0 > 0, [KPI1],0)+
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter2"),'KPI: Slicer'[Type] )+0 > 0, [KPI2],0)+
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter3"),'KPI: Slicer'[Type] )+0 > 0, [KPI3],0)
)
Hi, @Ncio
Please check the below picture and the sample pbix file's link down below.
The left side chart is the single selection, and the right side chart is the multi-selection (Sum).
Once you multi-select the slicer, the left chart will go back to the default, and the right chart will sum the selected measures.
All measures are in the sample pbix file.
https://www.dropbox.com/s/n1hwfr92e4ib8v9/diffaaa.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Assuming that all your measures return numbers you should be able to do something like
New Measure = sumx(values('measure slicer'[measure]),[Slicer Cumul annel])
This pattern might not perform very well as you add more visuals, measures or data to the report but should work.
@Ncio , try like
Graph: Slicer Cumul annuel =
calculate(
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter1"),'KPI: Slicer'[Type] )+0 > 0, [KPI1],0)+
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter2"),'KPI: Slicer'[Type] )+0 > 0, [KPI2],0)+
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter3"),'KPI: Slicer'[Type] )+0 > 0, [KPI3],0)
)
Works perfectly, thanks!
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 |
---|---|
117 | |
104 | |
77 | |
73 | |
50 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |