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
Anonymous
Not applicable

Average Sales when Multiple months are selected in the Slicer

I have an issue to calcaluate average of sales, cost, and commodity% when multiple months are selected from Slicer.

I have a table visual and month slicer as seen below

EalTim_0-1631543166845.png

 

The month Slicer is defaulted to select only one month and displaces the table visual above. The measure used was sum of Sales, cost, and Commodity% which works fine for only one month selected in the slicer. However, whenever I select multiple months, i was to calculate the average of Sales, Cost% and Commdity%, hence it should look like this

EalTim_1-1631543828875.png

Sales, cost, and commodity calculate it average based on the months selected in the Slicer. But Commodity% remains the same.

How can i achieve this to calculate weighted average od sales, cost and Commodity% using dax.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , if sales is a measure and you need month avg then try like

 

AverageX(Values(Date[Month Year]), [Sales] )

 

Assumed [Month Year] from date table

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , if sales is a measure and you need month avg then try like

 

AverageX(Values(Date[Month Year]), [Sales] )

 

Assumed [Month Year] from date table

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.