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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
abhiram342
Microsoft Employee
Microsoft 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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