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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Dynamic Selection - Multiple Categories

Hi All,

 

I would like to ask some help with the below.

 

I have Sales table connected with Customer table and Product table. Each customer in the Customer table is categorised 3 different ways (based on Product Divisions). I would like to create a "dynamic selection" or a measure (???) that would help me with the following.

If a certain Product Division is selected all visuals/tables/matrix in my PBI file should pick up the categories associated with that particular Division.

 

For example: 

Customer nameCustomer CountryCustomer group by HW deptCustomer group by SW deptCustomer group by Other
Contoso Ltd.GBMediumTester+100k
Van Arsdel Ltd.NLMediumEnd-user50-100k
Fabrikam Inc.USLowSupplier<20k
MicrosoftUSHighEnd-user+100k

 

HW Team categories for customers: Low/Medium/High

Other Team categories for customers: +100k/50-100k/<20k

Software Team categories for customers: Tester/End-User/Supplier

So essentially each customer is classified by all Divisions somehow. I also have other information about the customers, such as Country that I need to use for other visuals.

Let's say that user picks (or limited to see) HW products from the Product table then they should see HW Team Categories only. Also, I would like to use that selection in a slicer, bar chart, etc as their "Category"

When NO Product division is selected then this "Category" should be just "NA" or empty - for example if someone is responsible for a Customer (as in Key Account or cross-Divisional sales) not a Product Division there is no need to split Customers by Category. Hope this make sense.

 

Now, I can more or less solve the issue with Bookmarks (for each Division), however, Bookmarks do not work too well with different security levels/Roles. (or at least based on my knowledge).

Bookmarking is a solution, but I guess there is a more elegant way of doing this. I have a feeling that maybe with some conditional columns or a slightly different Data Model there would be a more efficient solution for this. This solution is also in my example file.

 

pbix file is attached

 

Thanks heaps in advance!

rszirmai

 

 

2 REPLIES 2
danextian
Super User
Super User

Hi @Anonymous 

 

If your data isn't too big, you may try this approach:

https://community.powerbi.com/t5/Desktop/Dynamic-Category-Using-a-Slicer/td-p/216971










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

@danextian 

Thanks a lot for your reply!

 

If I understand correctly, your FACT table is actually a flat table that already contains all the details from DIMENSION tables. That's what you index and then use the index to create the artificial dynamic slicer. Really nice approach!

Unfortunately, in my case it will not work, because:

  • I have lots of records in my fact table (invoice line items)
  • with my star schema there is no way to replicate what you did (it would be in a sense circular reference or kind of)

My main problem is that the Divisional data must come from the Products table and have to use the selected value from there to pick up my categories from Customer table.

Obviously, I would be able to eliminate the need of this difficult logic by simply creating 3 PBI dashboards, but I would prefer to have my data in 1 place.

 

Thanks

rszirmai

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.