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
Anonymous
Not applicable

Monthly Average

I have data in the following format. I'm quite new to PowerBi. I'm trying to find out monthly average for each of the categories below.

 

shormee_0-1652625911214.png

Can anyone please help me with DAX? I have to find out monthly average for column [Rate] considering both the categories [Location] and [Type]. I'm not sure how to solve this if I add two slicers with Location and category. 

 

Please see the following picture. Forming a similar graph is my target. I added two slicers with location and type to get this. But it plots sum of rate for each month. I want to plot average of rate for each month instead of sum . 

shormee_1-1652626251254.png

 

 

2 REPLIES 2
tackytechtom
Super User
Super User

Hi @Anonymous ,

 

I'd try it with the following measure:

MonthlyAverageRate = 
VAR _currMonth = MONTH ( SELECTEDVALUE ( Table[Date] ) )
RETURN 
CALCULATE (
    AVERAGE ( Table[Rate] ),
    REMOVEFILTERS ( Table[Date] ),
    MONTH ( Table[Date] ) = _currMonth
)

 

Here the result with the slicer on Location = 'D'

tomfox_0-1652628634683.png

 

I created an additional measure called AverageRate which does not consider the Average per month requirement:

AverageRate = CALCULATE ( AVERAGE ( Table[Rate] ) ) 
 
Here you can see, on the most granular level AverageRate just shows the same as Rate, whereas MonthlyAverageRate does return the mean rate in that month (January 2021)

 Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Anonymous
Not applicable

I have create a table "Create Average" and made this measure ==> 

AVERAGE = calculate(averagex('Create Average',[TotalRate]))

 

 

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.