Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi i actually had put a previous post but got no positive replies, so I have tried to narrow down where the issue is coming and re-issue same in a new post.
So this is a balance sheet that i made using power pivot DAX
As you can see Total Assets is not equal to Total Equity & Liabilities as the line "Cash in hand / at bank" is blank. Total Assets and Total Equity & Liabilities are calculated as DAX running totals and it is working fine.
Another important table is below which defines how the balance sheet works:
Below are 3 consecutive DAX measures to firstly calculate the bank balance, then secondly insert that amount as well as some other amounts inside the Balance Sheet and thirdly to summarize the data inserted:
Step1:
42bBMBSBankBalance:=VAR EndDate = max(BudgetCalendar[Date])
VAR Result = SUMX(SUMMARIZE (TabBSItem,TabBSItem[BSItem]), (CALCULATE([01BMBudgetDataAllLines],all(TabBSItem[BSItem]),all(BudgetCalendar[Date]),DATESBETWEEN(BudgetCalendar[Date],[38BMBS01aAlustreStartDateFirstYear],EndDate),BudgetInputsDatabase[Dimension3]<>"")+if([41BMBS03aNetProfitEURAllYearsTax]<0,0,[41BMBS03aNetProfitEURAllYearsTax]))*-1)
RETURN Result
Step2:
43bBMBS04AsAtAllTransactionAmountwithResultsYTD:=IF(IF(HASONEVALUE(TabBSItem[BSItem]),values(TabBSItem[BSItem]))="Results for the period",[41BMBS03aNetProfitEURCurrentYearAfterTax],IF(IF(HASONEVALUE(TabBSItem[BSItem]),values(TabBSItem[BSItem]))="Results b/f",[42BMBS03bNetProfitEURPreviousYearsAfterTax],IF(IF(HASONEVALUE(TabBSItem[BSItem]),values(TabBSItem[BSItem]))="Cash in hand / at bank",[42bBMBSBankBalance],[40BMBS02aAsAtAllTransactionAmountEUR])))
Step3:
44bBMBS05AllTransactionAmountwithSign:=SUMX(SUMMARIZE (TabBSItem,TabBSItem[BSItem]), CALCULATE( VAR result = [43bBMBS04AsAtAllTransactionAmountwithResultsYTD]*[37BMBSSignMeasure]
RETURN
result))
When i use these steps and after a few more measures, see below end result where the running totals for Total Assets and Total Equity & Liabilities are wrong:
One could say that maybe the measures in between are wrong but they are all actually correct. I did a test by replacing the first measure above by the amount directly and the results turn out right:
42bBMBSBankBalance:=6111918
I think the problem lies with summarizing the data but i cannot seem to address the issue.
Any help is most welcome, thanks 🙂
The issue you're facing with your Power Pivot model and DAX measures not producing the correct results could be due to various factors, including the complexity of the calculations, the relationships between tables, and the context in which the measures are used. Let's try to troubleshoot and optimize your DAX measures:
Step 1 - 42bBMBSBankBalance:
Step 2 - 43bBMBS04AsAtAllTransactionAmountwithResultsYTD:
Step 3 - 44bBMBS05AllTransactionAmountwithSign:
Context and Relationships:
Debugging:
Optimization:
Data Validation:
By carefully reviewing and debugging each step of your DAX measures and ensuring that your data and relationships are correctly set up, you should be able to identify and resolve the issue that is causing the incorrect results in your Power Pivot model.
Hi @123abc
If you see below picture which is already in post above, this is Step 1, 2, 3 and the final measure (there are some measures in between)
I replaced the first measure by the actual figure and you can see in below picture, everything works fine.
So i was hoping someone might be able to see a mistake in the DAX measures provided above 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
44 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
70 | |
48 | |
45 | |
19 | |
16 |