Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hi Team,
i want to calculte the opeging & closing balance by DAX in Power BI,
I have created the closing balance of first Week 30:
So the closing Balance of week 30 is the opening balance of Week 31
the closing Balance of week 31 is the opening balance of Week 32
like the table excel :
Row Labels | Closing Balance | INCOME | EXPENSES | Closing Balance |
WEEK 30 | 423 232 | 423 232 | ||
WEEK 31 | 423 232 | 219 646 | - 465 967 | 176 912 |
WEEK 32 | 176 912 | 34 | - 49 744 | 127 202 |
WEEK 33 | 127 202 | 509 788 | - 535 240 | 101 750 |
Thanks
Solved! Go to Solution.
Step 0: I use these data.
Step 1: I make some measures below.
M_WeekNo = WEEKNUM(MAX('Table'[Row Labels]))
M_Opening = SUMX(FILTER('Table','Table'[INCOME/EXPENSES]="Opening"),'Table'[Balance])
M_Income = SUMX(FILTER('Table','Table'[INCOME/EXPENSES]="INCOME"),'Table'[Balance])
M_Expenses = SUMX(FILTER('Table','Table'[INCOME/EXPENSES]="EXPENSES"),'Table'[Balance])
M_Opening RT = CALCULATE([M_Opening],FILTER(ALL('Table'),'Table'[Row Labels]<=MAX('Table'[Row Labels])))
M_Income RT = CALCULATE([M_Income],FILTER(ALL('Table'),'Table'[Row Labels]<=MAX('Table'[Row Labels])))
M_Expenses RT = CALCULATE([M_Expenses],FILTER(ALL('Table'),'Table'[Row Labels]<=MAX('Table'[Row Labels])))
M_Closing Balance = [M_Opening RT]+[M_Income RT]+[M_Expenses RT]
M_Opening Balance = CALCULATE([M_Closing Balance],ALL('Table'),DATEADD('Table'[Row Labels],-7,DAY))
Step 2: I make a matrix.
Thank you
Step 0: I use these data.
Step 1: I make some measures below.
M_WeekNo = WEEKNUM(MAX('Table'[Row Labels]))
M_Opening = SUMX(FILTER('Table','Table'[INCOME/EXPENSES]="Opening"),'Table'[Balance])
M_Income = SUMX(FILTER('Table','Table'[INCOME/EXPENSES]="INCOME"),'Table'[Balance])
M_Expenses = SUMX(FILTER('Table','Table'[INCOME/EXPENSES]="EXPENSES"),'Table'[Balance])
M_Opening RT = CALCULATE([M_Opening],FILTER(ALL('Table'),'Table'[Row Labels]<=MAX('Table'[Row Labels])))
M_Income RT = CALCULATE([M_Income],FILTER(ALL('Table'),'Table'[Row Labels]<=MAX('Table'[Row Labels])))
M_Expenses RT = CALCULATE([M_Expenses],FILTER(ALL('Table'),'Table'[Row Labels]<=MAX('Table'[Row Labels])))
M_Closing Balance = [M_Opening RT]+[M_Income RT]+[M_Expenses RT]
M_Opening Balance = CALCULATE([M_Closing Balance],ALL('Table'),DATEADD('Table'[Row Labels],-7,DAY))
Step 2: I make a matrix.
Need Help
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
102 | |
74 | |
42 | |
39 | |
31 |
User | Count |
---|---|
161 | |
87 | |
64 | |
46 | |
42 |