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
kozmar
Frequent Visitor

Power BI DAX Patterns Products/Locations

I have a need to identify products (and counts for % of total) based on the following scenerios. The locations are a slicer filter applicable to all. 

 

1. If the product exists in one location, flag it as SingleLoc

2. If the product exists in all the selected locations (count (locations_dim.Loc)), flag it as Shared

3. If the product exists in at least 2 of the selected locations, flag it as Common

 

I have some of this working, but it seems really complex. I am still working on the SingleLoc, but am thinking there has to be an easier way to do this. I am thinking I should be able to have flags on the product dimension, and set them dynamically based on facts grouping the count of products based on filters.

 

Anyway, appreciate any help.

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @kozmar,



I am thinking I should be able to have flags on the product dimension, and set them dynamically based on facts grouping the count of products based on filters.

According to your description, are you trying to add dynamic column calculation based on Slicer Selection in your product dimension table?

 

If that is the case, it is not possible to do it because calculated columns are initialized regardless of Slicers. However, you can create a measure to show the flag with the Products in the report. Here is a similar thread for your reference.

 

Regards

View solution in original post

5 REPLIES 5
kozmar
Frequent Visitor

We are good, the filter group by combination gives the needed results. Works great. thanks. I probably didn't describe the problem correctly. 

v-ljerr-msft
Employee
Employee

Hi @kozmar,



I am thinking I should be able to have flags on the product dimension, and set them dynamically based on facts grouping the count of products based on filters.

According to your description, are you trying to add dynamic column calculation based on Slicer Selection in your product dimension table?

 

If that is the case, it is not possible to do it because calculated columns are initialized regardless of Slicers. However, you can create a measure to show the flag with the Products in the report. Here is a similar thread for your reference.

 

Regards

Yes, that works. thanks! 

Hi @kozmar,

 

Great to hear the problem got resolved.Smiley Happy Could you accept the corresponding reply as solution to close this thread?

 

Regards

Yes!! reply accepted as solution. thanks.

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.