March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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
Solved! Go to Solution.
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
)
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.
DAX definitely takes some getting used to. I like it much better than Excel formulas now though (which tend to be difficult to read).
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
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
21 | |
16 | |
14 |