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
EZV12
Helper IV
Helper IV

How to calculate "Average" data in DAX?

Dear all,

I need help to calculate the Average data YTD/MTD in DAX. Here below please the Excel chart, the formula is simple in Excel to calculate the average data since January till the month to date, but how to transform it into DAX in PBI?

 

DataJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
Rate %92,10%92,70%91%         
             
             
DateAverage           
January92,10%           
February92,40%           
March91,93%           
April            
May            
June            
July            
August            
September            
October            
November            
December            
             

 

Thanks in advance for your help.

Best regards

Rachel

1 ACCEPTED SOLUTION

Hey @EZV12 ,

 

it would be helpful if you show the tables in Power BI and not in Excel. Like this I don't know how the data looks and can just guess how it would work.

This indicator you have to add to your measure then:

 

Average YTD Rate 1 =
CALCULATE(
    AVERAGE( myTable[myColumn] ),
    myTable[Indicators] = "Rate 1",
    DATESYTD( DateTable[Date] )
)

 

The same then for rate 2.

 

By the way, when you reply, make sure to link me @EZV12 , otherwise I will not be notified when you answer.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

4 REPLIES 4
selimovd
Super User
Super User

Hey @EZV12 ,

 

do you have a date table?

If yes, then you can ust the following function:

Average YTD =
CALCULATE(
    AVERAGE( myTable[myColumn] ),
    DATESYTD( DateTable[Date] )
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Hello Denis,

Thanks for your reply, however, in my data table, in one column, there are different values for different indicators. I need to calculate the cumulative average data YTD for each indicator. Here below please find a sample chart: 

How to modify your DAX formula accordingly? Thanks.

EZV12_0-1621968418681.png

 

Hey @EZV12 ,

 

it would be helpful if you show the tables in Power BI and not in Excel. Like this I don't know how the data looks and can just guess how it would work.

This indicator you have to add to your measure then:

 

Average YTD Rate 1 =
CALCULATE(
    AVERAGE( myTable[myColumn] ),
    myTable[Indicators] = "Rate 1",
    DATESYTD( DateTable[Date] )
)

 

The same then for rate 2.

 

By the way, when you reply, make sure to link me @EZV12 , otherwise I will not be notified when you answer.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Hello Denis,

It works! Many thanks!

Best regards

Rachel

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.