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
tasmiaa
Advocate I
Advocate I

DAX question about static vs dynamic calculation

*I'm simplifying the math involved and the numbers aren't really representative of what I'm calculating 

 

In Excel,

1. I have a calculation for a 3 Month Average Rate. The calculation takes the average of the last 3 months and returns a value. 

 

 janfebmarch
num526
den10235
rate0.50.0869571.2

 

3 Month Average Rate = 

0.595652

 

2. I have a second calculation for that is 3 Month Average Rate * den 

 

 janfebmarch
num526
den10235
rate0.50.0869571.2
calc25.95652213.72.978261

 

The 3 Month Average Rate stays static, but the den changes by month.

 

In Power BI,

1. I have a 3 Month Average Rate measure that calculates the average from the last 3 months. 

 

3 Month Average (%) = CALCULATE(SUM('table'num)/Sum('table'den),DATESINPERIOD('Date'[Date], [Selected Date], -3, MONTH))

2. I need to make a second measure that calculates 3 Month Average (%) * den, but the 3 Month Average (%) should be static and the den should be associated with the month it aligns to. How do I create a DAX measure that doesn't recalculate the 3 Month Average (%) by month and multiplies that by the changing den by month?

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @tasmiaa,

 

You can calculate the 3 Month Average Rate with a calculated column. While create a measure to multiply it with dynamical "den" values.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @tasmiaa,

 

You can calculate the 3 Month Average Rate with a calculated column. While create a measure to multiply it with dynamical "den" values.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.