Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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]))
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |