Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi PBI Community,
I am stuck on this step and could not figure out how to resolve it. Your suggestion/help will be much appreciated.
The attached screenshot shows two matrices, One shows Demand and the other shows Supply, Now I am stuck on how to calculate/measure demand-supply (Week-wise) and shows in it the table.
Many Thanks in Advance !!!
Solved! Go to Solution.
This may be tricky - how do you define the start of your balance? Basically sounds like a running total calculation?
Try a new Measure:
Diff = [_Total Supply Measure] - [_Total Demand Measure]
Then do running total of Diff:
Balance =
VAR _week = MAX(Date[WeekNum]
RETURN
CALCULATE([Diff], ALL(Date), Date[WeekNum] <= _week )
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@goyalsa What does your data model look like?
Assuming you have a DimDate table that is connected to both the Supply and Demand, you should be able to do:
Variance = SUM(Supply[Value]) - SUM(Demand[Value])
Then put it in a matrix with DimDate[WeekNumber]
https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thanks for the solution, I managed to calculate Supply and demand separately and put them on another matrix. But the stuck part is:
How to calculate:
Total supply at week 202130 - Total demand at week 202130 = Balance
Then,
For Week 202131,
Balance from week 202130 + Total supply at week 202131 - Total demand at week 202131 = Balance
Then,
Same for a further week, Like Week 202132
Balance from week 202131 + total supply at week 202132 - Total demand at week 202132 = Balance
Your help will be much appreciated !!
This may be tricky - how do you define the start of your balance? Basically sounds like a running total calculation?
Try a new Measure:
Diff = [_Total Supply Measure] - [_Total Demand Measure]
Then do running total of Diff:
Balance =
VAR _week = MAX(Date[WeekNum]
RETURN
CALCULATE([Diff], ALL(Date), Date[WeekNum] <= _week )
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 76 | |
| 38 | |
| 31 | |
| 27 | |
| 26 |