cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kozmar Frequent Visitor
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

Accepted Solutions
v-ljerr-msft Super Contributor
Super Contributor

Re: Power BI DAX Patterns Products/Locations

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

5 REPLIES 5
v-ljerr-msft Super Contributor
Super Contributor

Re: Power BI DAX Patterns Products/Locations

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

kozmar Frequent Visitor
Frequent Visitor

Re: Power BI DAX Patterns Products/Locations

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

kozmar Frequent Visitor
Frequent Visitor

Re: Power BI DAX Patterns Products/Locations

Yes, that works. thanks! 

v-ljerr-msft Super Contributor
Super Contributor

Re: Power BI DAX Patterns Products/Locations

Hi @kozmar,

 

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

 

Regards

kozmar Frequent Visitor
Frequent Visitor

Re: Power BI DAX Patterns Products/Locations

Yes!! reply accepted as solution. thanks.