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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Calculate Run Rate

Hello all, 

 

May i know how to write a DAX for Run Rate = ( Total Net Sales/9 month)*12 in power BI? 

i would like the date is automate means if going oct so the total run rate will calculate (total net sales/10month)*12. 

 

blur2teoh_1-1695889786113.png

 

 

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

Here I create a sample to have a test. I suggest you to create a Calendar table to help your calculation.

Calendar = ADDCOLUMNS(CALENDARAUTO(),"Year",YEAR([Date]),"Month",MONTH([Date]),"MonthShortName",FORMAT([Date],"MMM"))

Data model:

vrzhoumsft_0-1696218030445.png

Measure:

Net Sales = CALCULATE(sum('Table'[Value]))
Running Rate = 
VAR _LASTMONTH =
    CALCULATE (
        MAX ( Calendar[Month] ),
        FILTER (
            ALL ( 'Calendar' ),
            'Calendar'[Year] = MAX ( 'Calendar'[Year] )
                && [Net Sales] <> 0
        )
    )
VAR _Total =
    CALCULATE ( [Net Sales], ALLEXCEPT ( 'Calendar', 'Calendar'[Year] ) )
RETURN
    DIVIDE ( _Total, _LASTMONTH ) * 12

Result is as below.

vrzhoumsft_1-1696218041435.png

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

Here I create a sample to have a test. I suggest you to create a Calendar table to help your calculation.

Calendar = ADDCOLUMNS(CALENDARAUTO(),"Year",YEAR([Date]),"Month",MONTH([Date]),"MonthShortName",FORMAT([Date],"MMM"))

Data model:

vrzhoumsft_0-1696218030445.png

Measure:

Net Sales = CALCULATE(sum('Table'[Value]))
Running Rate = 
VAR _LASTMONTH =
    CALCULATE (
        MAX ( Calendar[Month] ),
        FILTER (
            ALL ( 'Calendar' ),
            'Calendar'[Year] = MAX ( 'Calendar'[Year] )
                && [Net Sales] <> 0
        )
    )
VAR _Total =
    CALCULATE ( [Net Sales], ALLEXCEPT ( 'Calendar', 'Calendar'[Year] ) )
RETURN
    DIVIDE ( _Total, _LASTMONTH ) * 12

Result is as below.

vrzhoumsft_1-1696218041435.png

 

Best Regards,
Rico Zhou

 

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

Hi, I need the same but for month

for example

in excel I have the formula

%compliance/daysworked*days of the month

in excel I have the formula
% compliance/days worked*days of the month

I try to do the same in power bi but is not working.

Can you help me please.

ChiragGarg2512
Super User
Super User

@Anonymous , Use of function average or averagex should work in this case. Otherwise provide data in tabular form.

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! Prices go up Feb. 11th.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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