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
Justas4478
Post Patron
Post Patron

Avera for measure

Hi, I have measure that calculates sales with filter for stores.

Store sales measure.PNG 

This is the measure

Trial store Sales = CALCULATE ([Sales Value Local CCY],FILTER (
'Store','Store'[Store Number] IN {"0021","0209","0231","0342",
"0621","0691","0716","0992","0012","0098","0184","0306",
"0413","0482","0670","0680","0893","1046"}))
 
I am trying to change it so it would calculate Average. But dax function for AVERAGE doesnt work since I am using Sales Value Local CCY that is a measure. Anyone know how to modify measure so it would work.
Due to live conection to the dataset I dont have access to the calculated columns use in power bi. Thank you.
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Justas4478 , Use some context/group by

 

Trial store Sales = CALCULATE (Averagex(Values('Store'[Store Number]) , [Sales Value Local CCY]),FILTER (
'Store','Store'[Store Number] IN {"0021","0209","0231","0342",
"0621","0691","0716","0992","0012","0098","0184","0306",
"0413","0482","0670","0680","0893","1046"}))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Justas4478 , Use some context/group by

 

Trial store Sales = CALCULATE (Averagex(Values('Store'[Store Number]) , [Sales Value Local CCY]),FILTER (
'Store','Store'[Store Number] IN {"0021","0209","0231","0342",
"0621","0691","0716","0992","0012","0098","0184","0306",
"0413","0482","0670","0680","0893","1046"}))

@amitchandak  Thanks this solution 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.