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
Drors
Resolver III
Resolver III

Sum monthly Average - DAX HELP

Hi,

 

I have a table like :

Date  CustomerID  TotalPrice

 

and I have create 3 measures :

1. Sum of total price

2. Count of distinct customer

3. avarege - measure 1 / measure 2

 

When I use it on a chart with yearmonth on the X axis everything works fine.

But I want to sum that avg for a year view.

I mean if I have on

jan2018 -avg= 100

feb18 - avg =200

march18 - avg =250

I will want to see on 2018 sumavg 550

if I just put the year on the X axis it will make avg for the all year and not only by month

its make a problem because i have diffrent number of customers each month and it will not reflect the real snapshot for my bussiness.

 

Thanks for your help.

1 ACCEPTED SOLUTION
Floriankx
Solution Sage
Solution Sage

Hello,

 

you could try to SUMMARIZE and SUMX:

 

YearAvg=
SUMX(
 SUMMARIZE(Table,
[YearColumn],
[MonthColumn],
"Sum of total price",SUM([Price],
"CountOfCustomer",DISTINCTCOUNT([CustomerID])),
[Sum of total price]/[CountOfCustomer])

Best regards

View solution in original post

2 REPLIES 2
Floriankx
Solution Sage
Solution Sage

Hello,

 

you could try to SUMMARIZE and SUMX:

 

YearAvg=
SUMX(
 SUMMARIZE(Table,
[YearColumn],
[MonthColumn],
"Sum of total price",SUM([Price],
"CountOfCustomer",DISTINCTCOUNT([CustomerID])),
[Sum of total price]/[CountOfCustomer])

Best regards

Hi,

 

@Floriankx Thank you, it works

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.