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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Justas4478
Post Prodigy
Post Prodigy

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"}))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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"}))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak  Thanks this solution works.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.