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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
damguy09
Frequent Visitor

Grouping / Filtering from two dimensional tables

Thank you in advance for any help.

 

I hope I can explain this well enough.  I have a regular star schema model and I want to create a groups for:  Strategic, Core, Opportunistic - that is based on (2) dim tables Product Group & Market.  I want to create a measure that would filter the data to each of these groups based on a separate strategic table where I have identified each Product Group & Market combination.

 

For Example (product group/market):

 

Bike / Off-Road --> Strategic

Bike / Road --> Core

 

Both Product Group & Market are attached to the Sales Table.

 

I was thinking this was a crossfilter, but can't figure it out.  

3 REPLIES 3
mhough
Regular Visitor

In a recent DAX training that I completed, I saw a relevant example. The function that you need is CROSSJOIN. The parameters of the function ask you for two tables, but you can use VALUES to get unique instances of each dimension. Something like this:

 

Crosstable = CROSSJOIN(
VALUES( Types[Channel Type]),
VALUES(Categories[Category] ) )
 
This would create a physical table, but you can use it within a measure as well to iterate over this temp table with SUMX
 
 
One word of caution, I've heard this function can cause performance issues in a large model and also that there is a function GENERATE that works in a similar fashion. That is worth looking into as well.
tctrout
Resolver III
Resolver III

I believe the simplest way to achieve your goal on getting 2 unrleated dimensions (though they share a relationship to your fact) for unique DAX combinations would be to combine your 2 dimension tables into a sinlge master dimension table.

Its basically a cartesian product equivelant, giving you all possible combinations of the 2 dimension tables.

 

Once unified, you should be able to acheive your desired results.

Thanks tctrout.

 

To make sure I'm understanding, create a 3rd dim table that is the concatenate of the keys of both separate dim tables and then code this new table with the new dimensional fields.  Connect this to the Fact table via the same concatenated key to give a new dimension.  

 

I can see this work but was hoping for something that might be in a measure to push through the filtering on a simplier table.  

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors