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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ljx0648
Helper II
Helper II

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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