Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello Community,
I need help to create a slicer. Basically I have a report where I have created 20 measures, they show 2 different data, GrossGross and GrossNet.
I also have a table with all the measures on it.
What I want to do is create a slicer (with two buttons: GrossGross and GrossNet) where I can filter the table. Is there any possibility to group the measures and have a slicer that will filter my table depending if I want to show GrossGross data or GrossNet data?
Thank you so much for your help!!
Manu
Hi @ManuApo
I build a sample to show you how to show result with different data in same measure by slicer.
Slicer Table:
GrossNet:
GrossGross:
Here I build a easy sample by sum function, you can add different measures behind _GrossNetData and _GrossGrossData and use if function to achieve your goal.
Sample =
Var _Select = SELECTEDVALUE(Slicer[TableName])
VAR _GrossNetData = SUM(GrossNet[Value])
VAR _GrossGrossData = SUM(GrossGross[Value])
Return
IF(ISFILTERED(Slicer[TableName]),IF(_Select = "GrossNet",_GrossNetData,_GrossGrossData),BLANK())
You measure should looks like as below.
Sample =
Var _Select = SELECTEDVALUE(Slicer[TableName])
VAR _GrossNetData = [GrossNetMeasure]
VAR _GrossGrossData = [GrossGrossMeasure]
Return
IF(ISFILTERED(Slicer[TableName]),IF(_Select = "GrossNet",_GrossNetData,_GrossGrossData),BLANK())
In result screenshots you can find, it will show blank by default, and will show the result calculated by the data in selected table.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-rzhou-msft
Thanks for your reply. But I think unfortunately is not working
What if I have 10 measures for GrossNet and another 10 measures for GrossGross.
What I want is a slicer for those 2 group of measures that filters a table ( visual )
Thanks again,
Manu
Hi @ManuApo
Do you mean that you have a table visual built by measures in two groups and you want to show only one group of measures by slicer?
You can try the same way to update your measures and the measures out of the group you selected will show blank.
You can put your original measure in _SampleMeasure Field. You need to build a group slicer as above to create the slicer.
GrossGrossData1 =
VAR _Select = SELECTEDVALUE('Group'[Selection])
VAR _SampleMeasure = SUM('Table'[Value])+4
VAR _NewMeasure = IF(ISFILTERED('Group'[Selection]),IF(_Select = "GrossGross",_SampleMeasure,BLANK()),_SampleMeasure)
RETURN
_NewMeasure
GrossNetData1 =
VAR _Select = SELECTEDVALUE('Group'[Selection])
VAR _SampleMeasure = SUM('Table'[Value])+1
VAR _NewMeasure = IF(ISFILTERED('Group'[Selection]),IF(_Select = "GrossNet",_SampleMeasure,BLANK()),_SampleMeasure)
RETURN
_NewMeasure
Result:
By default, your table will show all measures.
Select “GrossGross”
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI Manu,
This may help...
How To Use A Slicer To Select Different Measures | Power BI (burningsuit.co.uk)
Stuart
@ManuApo there is no concept of filtering the measure table, you have to build this logic in each measure based on your slicer selection.
Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to 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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
145 | |
85 | |
66 | |
52 | |
48 |
User | Count |
---|---|
215 | |
90 | |
83 | |
67 | |
59 |