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.
I have written this DAX function but its not showing correct total.its showing 0 total but toal should be -6407667.
Cumulative Balance = IF ( [ShowValueForDates], SWITCH(SELECTEDVALUE(glaccounts[IncomeBalance]), "Balance Sheet", CALCULATE(SUM(glentries[amount]),FILTER(ALL('date'), 'date'[Date] <= MAX('date'[Date]))), "Income Statement", CALCULATE(TOTALYTD(SUM(glentries[Amount]),'date'[Date])),0) )
Please help me to solve this.
Thanks
Solved! Go to Solution.
Hi @ashapr ,
I suggest you to try to create a new measure based on [Cumulative Balance] measure instead of sumx it directly.
Cumulative Balance with correct subtotal =
SUMX ( 'glentries', [Cumulative Balance] )
If this reply still couldn't help you solve your problem, please share a sample file with me and show me the result you want. This will make it easier for me to find the solution.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@ashapr ,Try a measure like
Cumulative Balance = sumx(values(glaccounts[IncomeBalance]),calculate(IF ( [ShowValueForDates], SWITCH(SELECTEDVALUE(glaccounts[IncomeBalance])
, "Balance Sheet", CALCULATE(SUM(glentries[amount]),FILTER(ALL('date'), 'date'[Date] <= MAX('date'[Date])))
, "Income Statement", CALCULATE(TOTALYTD(SUM(glentries[Amount]),'date'[Date])),0) )))
i will try and see.really thanks to you .if you can tell me what is the error in the code that i have written,that would be great.
Hi @ashapr ,
I suggest you to try to create a new measure based on [Cumulative Balance] measure instead of sumx it directly.
Cumulative Balance with correct subtotal =
SUMX ( 'glentries', [Cumulative Balance] )
If this reply still couldn't help you solve your problem, please share a sample file with me and show me the result you want. This will make it easier for me to find the solution.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |