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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ljx0648
Helper I
Helper I

Create a slicer with binary information from multiple columns

Hi guys,

 

I have a customer count table as per below:

 

ljx0648_0-1715285348545.png

 

Customer Count = the count of customer with the attribute on the right.

 

Use 1st row for instance, there is 1 customer with Mutual Fund ONLY (Mutual = Y, GIC & CASH = N).

 

I am looking for a way to create a slicer that looks like this 

With Mutual Fund
With GIC

With Cash

 

Thus, if I select With Mutual Fund , I will get customer count = 1+1+2+3+4+5 = 16 (all the rows with mutual fund = Y)

 

Lastly, if I multi-select With Mutual Fund & With GIC, I will get customer count = 1+2+3+4+5 = 15 (all the rows with mutual fund = Y AND with GIC = Y).

 

Any idea is much appreciated!

 

Thank you

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @ljx0648 
To get the desired result :
You need to unpivot the table from PQ :

Ritaf1983_0-1715315047537.pngRitaf1983_1-1715315121672.png

At this stage you can create simple dax measure :

Count_Y = CALCULATE(COUNTROWS('Table'),'Table'[Value]= "Y")
Result :
Ritaf1983_2-1715315722602.png

Pbix is attached

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

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @ljx0648 
To get the desired result :
You need to unpivot the table from PQ :

Ritaf1983_0-1715315047537.pngRitaf1983_1-1715315121672.png

At this stage you can create simple dax measure :

Count_Y = CALCULATE(COUNTROWS('Table'),'Table'[Value]= "Y")
Result :
Ritaf1983_2-1715315722602.png

Pbix is attached

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

Hi Ritaf,

Thank you for your idea. Your idea works as listed!

 

Happy to help 🙂

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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