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! Learn more

Reply
PowerBI_User__
Frequent Visitor

Slicer_Add Multiple Columns in a Slicer that are not a Hierarchy

Hello,

I'd like to add a slicer to filter on the account ID by Program Type. The slicer should have a dropdown list including:

Program A

Program B

 

What's the best way to buid that?

 

Account IDProgram AProgram B
1702892911      x 
1702853685      x      x
1702848829  
2 ACCEPTED SOLUTIONS
Alex_Sawdo
Resolver II
Resolver II

In a case like this, it would probably be easier to structure this in Power Query over trying to write a complex DAX function. What you can do is reference the initial query and unpivot your new table so program A and B are in one column, differentiated by an attribute. Then, you can join your first table with this new table and add a slicer based on the new table. Then in your measure, you can filter the new table for values that aren't blank to get an accurate count. 

Alex_Sawdo_0-1680877491104.png

Measure =
CALCULATE(
    COUNT(
        'Fact'[Account ID]
    ),
    FILTER(
        'Fact',
        'Fact'[Value] <> BLANK()
    )
)

View solution in original post

Hello,

 

So this is a very similar scenario to the other post I linked you to, except you can skip the split by delimiter step. You just need the unpivot step. Once you unpivot the Program A and Program B columns, then delete Values column with all x's, you'll see the below.

 

Wilson__0-1680896792916.png

 

Then if your table is joined if joined to other tables by the Account ID, you should be able to use the Attribute field (you can rename it in the Power Query steps to "Program" or something) as your slicer.

 

Let me know if that's what you're looking for. Hopefully it makes sense. 😄


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

11 REPLIES 11
Alex_Sawdo
Resolver II
Resolver II

In a case like this, it would probably be easier to structure this in Power Query over trying to write a complex DAX function. What you can do is reference the initial query and unpivot your new table so program A and B are in one column, differentiated by an attribute. Then, you can join your first table with this new table and add a slicer based on the new table. Then in your measure, you can filter the new table for values that aren't blank to get an accurate count. 

Alex_Sawdo_0-1680877491104.png

Measure =
CALCULATE(
    COUNT(
        'Fact'[Account ID]
    ),
    FILTER(
        'Fact',
        'Fact'[Value] <> BLANK()
    )
)

Many Thanks Alex!!

Yes, creating a new table and unpivoting the columns wokred! And I connected the 2 tables with a bi-directional filter!

 

Thanks a lot for your response!

Wilson_
Super User
Super User

Hello,

 

I just helped a different user with the same or similar issue this week here. Please let me know if that works for you. Happy to help if you read through there and it's not what you were looking for. 😄


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi Wilson,

 

  • Thanks a lot for your reply. I read through the other solution but I am not following through 😕 I think my case is simpler. So my dataset is connected to the "account ID". And I'd like to be able to filter the views on the account IDs based on the "Program Type". i.e Program A contains a set of these account IDs, and Program B contains another set of these account IDs. 

I see, maybe I've misunderstood your data model or your request. I assumed the table in your original post was the table in your pbix. Is it?

 

I'm also honestly not quite following how you're describing what you're looking for. Can you provide a visual of what you would like to see in a final result?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi Wilson,

 

Yes, please find attached a sample of the table I am loading to powerbi. The final result I am looking for, is having one slicer where I can filter between Program A "TREX" and Program B"Delphix".  The dataset is connected to the account ID, so when I filter on those two columns, all other views will get filtered on the accounts under each program.Sample Data 

PowerBI_User___0-1680895360729.png

Hello,

 

So this is a very similar scenario to the other post I linked you to, except you can skip the split by delimiter step. You just need the unpivot step. Once you unpivot the Program A and Program B columns, then delete Values column with all x's, you'll see the below.

 

Wilson__0-1680896792916.png

 

Then if your table is joined if joined to other tables by the Account ID, you should be able to use the Attribute field (you can rename it in the Power Query steps to "Program" or something) as your slicer.

 

Let me know if that's what you're looking for. Hopefully it makes sense. 😄


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi Wilson,

yes now it's clear 🙂 so I have created a new table and unpivoted the columns, because when I unpivoted the columns in the same table I get duplicate account IDs, which is messing with the inner joins I have with all the other tables. I connected the new table with the old with 1:1 relationship of the account ID. The slicer is based on the new "attribute" colun but it's still not working.. I guess I still need one more step?

Hello,

 

Hard to say without knowing anything about the rest of your data model. It might be as simple as turning bi-directional filtering on between the original table you shared and the unpivoted table you created and linked to. It might also not be, again, based on the rest of your data model.

 

Any chance you can share your pbix (or at least a smaller sample version)?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi Wilson

Thanks a lot mate! You're brilliant 🙂 Yes turning on the bi-directional filter between both tables made the slicer work!

 

Many Thanks for your support and prompt response!!

Awesome, you're welcome. Glad that worked for you.

 

It seems without the bi-direction filtering, filtering the new unpivoted table was not propogating back to the original table, which was needed to filter through the rest of your tables. 🙂




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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