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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
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 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors