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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
SwathiKundar
Frequent Visitor

Average Daily Spend

Hello All.

I need to calculate the Average Daily Spend.

Average Daily Spend = Total cost / Avg Days for the selected period.
ex: If we select the period 1 to 25 then Average days should be 25.

currently  total rows of Average Daily Spend column in average. But I need to show it in SUM instead of AVERAGE.
According to the below DAX, logic is working fine except for total rows.

Avg Days =

var startofthisperiod = FIRSTDATE(Dates[Date])

var endofthisperiod =LASTDATE(Dates[Date])+1

var noOfDays = DATEDIFF (startofthisperiod, endofthisperiod,DAY)

return

noOfDays



AVG Daily Spend =

DIVIDE(SUM(Table[Cost]),

[Avg Days]

)

 

 

 

Thanks in Advance.
Swathi Kundar

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @SwathiKundar ,

 

Please try to create a measure like below:

Measure = SUMX(VALUES('Table'[Month]),[AVG Daily Spend])

Vlianlmsft_0-1638857059821.png

 

 

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

AlexisOlson
Super User
Super User

It's possible but that's a pretty strange total to show. How do you interpret it? What does that sum of averages represent?

If it's possible then how achieve it.

You'd need to iterate over one level of granularity where you take the average below that level and sum up those averages. I can't tell what determines what level of granularity you want to change your aggregation rule at though.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors