cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

DAX formula weighted average support requested

Hello community,

Can someone help me with a DAX formula to calculate average sales per store per period and per region as in the below example?

Even after reading many questions on the same topic, I can't get it to work. My DAX attempt in the screenshot comes close but the aggregated results on period level and store level are ok, but not on total and not on Region level.

Here is the model and my DAX attempt (DIVIDE(SUM(fact_Sales[Sale]);SUMX(fact_Sales;RELATED(dim_Regions[Number of stores]));0))

Thanks in advance for any support.

Michel

1 ACCEPTED SOLUTION
Super User

Assuming you're using dim_Regions[Region] in your visual, you should be able to define the ratio as:

``````Sales per store =
DIVIDE (
SUM ( fact_Sales[Sale] );
SUM ( dim_Regions[Number of stores] );
0
)``````
3 REPLIES 3
Regular Visitor

Hello AlexisOlson,

Thanks for your reply, this is indeed the (a?) solution that solves the problem from my question. It shows me again that I'm not used to thinking in a DAX way, in Excel I would have solved the issue probably much faster.

Super User

DAX definitely takes some getting used to. I like it much better than Excel formulas now though (which tend to be difficult to read).

Super User

Assuming you're using dim_Regions[Region] in your visual, you should be able to define the ratio as:

``````Sales per store =
DIVIDE (
SUM ( fact_Sales[Sale] );
SUM ( dim_Regions[Number of stores] );
0
)``````

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors