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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
siva3012
Helper II
Helper II

Create new measure to get Average

Hi, I have a table which contains Date, CustomerName, Price, month, & weekday.

 

I have created measure using the DAX, Day 1 = CALCULATE(sum(Actual[Price]),FILTER('Actual','Actual'[Day]=1))

similarly for all days. If i select 3 months at a time i am getting the total values, as shown in the figUntitled.png

My query is  I need to get an average value's if i select 2 or 3 months in the slicer.  Anyone has an idea how to solve this ?

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @siva3012,

 

Create an extra measure like:

Count month selected = DISTINCTCOUNT(Actual[Month])

Modify the measure for Day 1 as below:

Day 1 = CALCULATE(sum(Actual[Price]),FILTER('Actual','Actual'[Day]=1))/[Count month selected]

Result.

1.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @siva3012,

 

Create an extra measure like:

Count month selected = DISTINCTCOUNT(Actual[Month])

Modify the measure for Day 1 as below:

Day 1 = CALCULATE(sum(Actual[Price]),FILTER('Actual','Actual'[Day]=1))/[Count month selected]

Result.

1.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft : Is it possible to draw an average line for those data which is shown in the graph ? Like this 

1.jpg

 

 

 

@v-yulgu-msft : Hi, There is an small eror in the solution. If we select 2 Months data Jan & Feb in slicer. Jan has 31 days and Feb has 28 days. The average is been calaculated wrongly for Jan 29, 30 & 31. 

1.jpg

 Do you have any idea over this ?

 

 

I have solved this issue,

Day 1 = CALCULATE(sum(Actual[Price]),FILTER('Actual','Actual'[Day]=1))/(CALCULATE([Count month selected],Actual[Day]=1))

@v-yulgu-msft : Thank you for the solution.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors