The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
hello i have a table
say for initial month 1:
Name | Pay | Previous Pay | Total Pay |
A | 1000 | 1000 | |
B | -2000 | -2000 | |
C | -1000 | -1000 | |
Total | -2000 | -2000 |
and if i select month 2:
Name | Pay | Previous Pay | Total Pay |
A | 500 | 1000 | 1500 |
B | 3000 | -2000 | 1000 |
C | 4000 | -1000 | 3000 |
Total | 7500 | -2000 | 5500 |
measure is :
Pay = sum([pay])
previous pay = calculate([pay],previousmonth)
total pay = if([previous pay] < 0 ,[pay]+[previous pay],[pay])
when i do this measure, it only affects the negative numbers and i get this:
Name | Pay | Previous Pay | Total Pay |
A | 500 | 1000 | 500 |
B | 3000 | -2000 | 1000 |
C | 4000 | -1000 | 3000 |
Total | 7500 | -2000 | 4500 |
so how can i say if total of [previous pay] < 0 then add previous with current pay
but this isnt my desired result:
my desired result is the thrid table which is this:
Name | Pay | Previous Pay | Total Pay |
A | 500 | 1000 | 1500 |
B | 3000 | -2000 | 1000 |
C | 4000 | -1000 | 3000 |
Total | 7500 | -2000 | 5500 |
Solved! Go to Solution.
@Anonymous , change the measure like
total pay =
sumx(Values(Table[Name]), if([previous pay] < 0 ,[pay]+[previous pay],[pay]))