Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I am new to Power bi and need some help with the slicer logic.
Here is my test data.
Customer | Type |
10 | A |
10 | B |
11 | A |
11 | B |
12 | A |
12 | B |
13 | A |
13 | B |
14 | A |
14 | B |
When the user selects 12A, ONLY the below data should be visible in the report.
10 | A |
10 | B |
11 | A |
11 | B |
12 | A |
And if the user selects 12B, only the below data should be visible in the report.
10 | A |
10 | B |
11 | A |
11 | B |
12 | B |
Solved! Go to Solution.
@MM2023 , 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 ))
Hi , @MM2023
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:
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
Hi , @MM2023
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:
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
@MM2023 , 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 ))
@MM2023 , Please share the logic, I done it based on what I got
@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.
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |