Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don'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.

Reply
ManuApo
Helper II
Helper II

Struggling creating a slicer :(

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

 

5 REPLIES 5
v-rzhou-msft
Community Support
Community Support

Hi @ManuApo 

I build a sample to show you how to show result with different data in same measure by slicer.

Slicer Table:

1.png

GrossNet: 

2.png

GrossGross:

3.png

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.

1.png2.png3.png

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.

 1.png

Select “GrossGross”

2.png

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. 

 

Burningsuit
Resident Rockstar
Resident Rockstar

parry2k
Super User
Super User

@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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.