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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Power bi slicer logic

Hi All,

I am new to Power bi and need some help with the slicer logic.

Here is my test data.

Customer Type
10A
10B
11A
11B
12A
12B
13A
13B
14A
14B

 

When the user selects 12A, ONLY the below data should be visible in the report.

10A
10B
11A
11B
12A

And if the user selects 12B, only the below data should be visible in the report.

10A
10B
11A
11B
12B
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , You need to create two independent table

 

Customer  = Distinct(Table[Customer])

Type = Distinct(Table[Type])

 

Use them in a slicer and have measure like, and use with your original table column

 

Measure =

var _tab = summarize(filter(Table, Table[Type] in Values(Type[Type])  && not(Table[Customer] in Values(Customer[Customer]))  ), Table[Customer])

return

countrows( filter( Table, ( Table[Type] in Values(Type[Type])  && (Table[Customer] in Values(Customer[Customer])) )

|| Table[Customer] in _tab  ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

Here are the steps you can refer to :
We need to click "New Table" to create a table as a slicer:

Slicer = ADDCOLUMNS('Table' ,"Combine", CONCATENATE([Customer],[Type]))

 Then we can create a measure :

Measure = var _s_customer =MAX('Slicer'[Customer])
var _s_type = MAX('Slicer'[Type])
var _cur_customer = MAX('Table'[Customer])
var _cur_type = MAX('Table'[Type])
return
IF(_cur_customer< _s_customer ,1 , IF(_cur_customer=_s_customer &&_s_type=_cur_type,1,0  ))

Then we can put the 'Slicer'[Combine] on the slicer visual and configure the measure on the "Filter on this visual" and we can meet your need:

vyueyunzhmsft_0-1674443744990.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

6 REPLIES 6
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

Here are the steps you can refer to :
We need to click "New Table" to create a table as a slicer:

Slicer = ADDCOLUMNS('Table' ,"Combine", CONCATENATE([Customer],[Type]))

 Then we can create a measure :

Measure = var _s_customer =MAX('Slicer'[Customer])
var _s_type = MAX('Slicer'[Type])
var _cur_customer = MAX('Table'[Customer])
var _cur_type = MAX('Table'[Type])
return
IF(_cur_customer< _s_customer ,1 , IF(_cur_customer=_s_customer &&_s_type=_cur_type,1,0  ))

Then we can put the 'Slicer'[Combine] on the slicer visual and configure the measure on the "Filter on this visual" and we can meet your need:

vyueyunzhmsft_0-1674443744990.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Anonymous
Not applicable

Thank you so much @v-yueyunzh-msft. Excellent solution 🙂

amitchandak
Super User
Super User

@Anonymous , You need to create two independent table

 

Customer  = Distinct(Table[Customer])

Type = Distinct(Table[Type])

 

Use them in a slicer and have measure like, and use with your original table column

 

Measure =

var _tab = summarize(filter(Table, Table[Type] in Values(Type[Type])  && not(Table[Customer] in Values(Customer[Customer]))  ), Table[Customer])

return

countrows( filter( Table, ( Table[Type] in Values(Type[Type])  && (Table[Customer] in Values(Customer[Customer])) )

|| Table[Customer] in _tab  ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you for trying  @amitchandak. This won't work. Thanks again.

@Anonymous , Please share the logic, I done it based on what I got

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak I already asked what  I want in my post. Looks like you did not read my post. 

 

Can someone HELP me? It s very urgent. Thank you.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors