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 a list of account balances both positive and negaitive. The account balance is calculated using a measure, i then would like to sum only the negative values and display by account type. When i do this it will only display the negative balances if the sum of the every account in the account type is negative instead of displaying the sum of all the negative values within each account type.
Can any one please advise.
Solved! Go to Solution.
In this scenario, to sum the negative values, you just need to filter those negative rows in your calculation. Please refer to my sample below:
1. Create Total measure group on Type:
Total = CALCULATE(SUM(Table1[Value]),ALLEXCEPT(Table1,Table1[Type]))
2. Create Negative Total measure:
Negative Total = CALCULATE(SUM(Table1[Value]),FILTER(Table1,Table1[Value]<0),ALLEXCEPT(Table1,Table1[Type]))
3. Create the conditional Total as you required:
Conditional Total = IF([Total]<0,[Negative Total],[Total])
The result looks like below:
Regards,
In this scenario, to sum the negative values, you just need to filter those negative rows in your calculation. Please refer to my sample below:
1. Create Total measure group on Type:
Total = CALCULATE(SUM(Table1[Value]),ALLEXCEPT(Table1,Table1[Type]))
2. Create Negative Total measure:
Negative Total = CALCULATE(SUM(Table1[Value]),FILTER(Table1,Table1[Value]<0),ALLEXCEPT(Table1,Table1[Type]))
3. Create the conditional Total as you required:
Conditional Total = IF([Total]<0,[Negative Total],[Total])
The result looks like below:
Regards,
Hi,
Just to confirm SUM presented by "Conditional Total" will not work in this case as its measure correct ? I wanted to display conditional total from only those measures whose value is positive.
Regards
Digant
Thank you, this worked perfectly.
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 |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |