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
abhiram342
Employee
Employee

Calculation Groups with respect to dimension

Hi Team,

 

We have fact and dimension and want to re-use same measure across different dimensions. Can you please tell if there is way to achieve in DAX?

For Example:

Consider, We have Fact Table

DateIdProductIdCustomerIdRegionIdIndustryIdAmount
20220501Axyz24100

Above Fact is related to corresponding Dimension Tables ( Product, Customer,Region,Industry)

We want to calculate measures as below

[Dimension] Count -- distinct values in Fact Table for corresponding dimension (ex: count(distinct ProducId)

[Dimension] MoM # -- Based on [Dimension Count]

 

Example: We have solution to create each measure seperately as below but looking is there any option to reuse the single measure across different dimensions ( similar to calculation groups i.e SELECTEDMEASURE() , do we have concept like SELECTEDDIMENSION()).

 

Please suggest if there are better ways to solve below problem

 

we are planning to create measures as below

Product Count

Product MoM#

 

Customer Count

Customer MoM #

 

Industry Count

Industry MOM #

 

Region Count

Region MOM #

 

Thanks,

Abhiram

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @abhiram342 , 

 

This post may help you: Introduction to Tabular Editor for Business Users - Excelerator BI

 

1. For "distinct values in Fact Table for corresponding dimension", you can try to modify the script below to meet your scenario to generates measures on every selected column to create counts.

 Tabular-Editor-8.png

 

 

2. For MOM based on the measures above, change the script below to meet your requirements:

Tabular-Editor-14.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @abhiram342 , 

 

This post may help you: Introduction to Tabular Editor for Business Users - Excelerator BI

 

1. For "distinct values in Fact Table for corresponding dimension", you can try to modify the script below to meet your scenario to generates measures on every selected column to create counts.

 Tabular-Editor-8.png

 

 

2. For MOM based on the measures above, change the script below to meet your requirements:

Tabular-Editor-14.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

johnt75
Super User
Super User

As long as you have one-to-many relationships from your dimension tables to your fact table then any measures should work across all dimensions. Just put the appropriate column from your dimension table into a visual with the measure, or use the dimension table columns as filters, and it should just work.

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.

Top Solution Authors