March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Power Bi Community,
I would like your help to solve how I can visualize in a Bar chart the Avarage volume of money a User spends in a month.
What I tried to use is the following measure:
Solved! Go to Solution.
Hi @ronin995 ,
In your formula, you use the ISONORAFTER function, which will include all dates less than the current date in the chart. Modify the formula to:
AVG Volume per User by Month =
VAR money_ =
CALCULATE (
SUMX ( Sales, Sales[products] * ( Sales[price] / 100 ) ),
FILTER (
ALL ( 'Sales' ),
EOMONTH ( 'Sales'[created_at], 0 ) = EOMONTH ( MAX ( 'Calendar'[Date] ), 0 )
&& Sales[status] = "SOLD"
)
)
VAR AVG_per_User =
CALCULATE (
DIVIDE ( money_, [Total Users] ),
FILTER (
ALLSELECTED ( 'Sales'[created_at] ),
EOMONTH ( 'Sales'[created_at], 0 ) = EOMONTH ( MAX ( 'Calendar'[Date] ), 0 )
)
)
RETURN
AVG_per_User
Get the correct result in my sample, I attach my sample below for your reference.
Reference: EOMONTH function (DAX) - DAX | Microsoft Docs
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ronin995 ,
In your formula, you use the ISONORAFTER function, which will include all dates less than the current date in the chart. Modify the formula to:
AVG Volume per User by Month =
VAR money_ =
CALCULATE (
SUMX ( Sales, Sales[products] * ( Sales[price] / 100 ) ),
FILTER (
ALL ( 'Sales' ),
EOMONTH ( 'Sales'[created_at], 0 ) = EOMONTH ( MAX ( 'Calendar'[Date] ), 0 )
&& Sales[status] = "SOLD"
)
)
VAR AVG_per_User =
CALCULATE (
DIVIDE ( money_, [Total Users] ),
FILTER (
ALLSELECTED ( 'Sales'[created_at] ),
EOMONTH ( 'Sales'[created_at], 0 ) = EOMONTH ( MAX ( 'Calendar'[Date] ), 0 )
)
)
RETURN
AVG_per_User
Get the correct result in my sample, I attach my sample below for your reference.
Reference: EOMONTH function (DAX) - DAX | Microsoft Docs
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yanjiang-msft I tried it out and it works as you explained with the example, it was a great learning! Thank you very much!
@v-yanjiang-msft thanks, i'll try out the solution you gave me right away and let you know!
@ronin995 , Based on what I got, Try a measure like
Cumm = CALCULATE(averageX(values('Date'[Month Year]),calculate(SUM(Sales[Sales Amount]))) ,filter(allselected('Date'),'Date'[date] <=max('Date'[date])))
Hi @amitchandak, unfortunately when I tried to do as you suggested. I get nothing in the chart as it doesn't select any of the data
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
73 | |
58 | |
52 |
User | Count |
---|---|
196 | |
125 | |
107 | |
68 | |
65 |