Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone, i have as i believe a simple question.
I have a ddbb with a small structure (only this columns: account(revenue and expenses), type (there are 3 types, actual, plan and last year), and ammount $). I need to create a calculate field who gave me the account (revenue) but only when the type is actual. the idea is multiply that new calculated field *-1 because its a negative value in the ddbb. There is possible to do this?
Thanks in advance
Solved! Go to Solution.
Hi! I created some dummy data to demonstrate what I did:
With this data I then created the following measure:
TotalRevenueActual :=
CALCULATE(
SUM('YourTableName'[Amount]),
'YourTableName'[Account] = "Revenue",
'YourTableName'[Type] = "Actual"
)
The results:
And, -100 is accurate as it is the amount where Account is Revenue and Type is Actual. Hope this helps!
Another option would be in Power Query - you can pivot the data so that Revenue and Expense are two different columns.
Proud to be a Super User! | |
Hi! I created some dummy data to demonstrate what I did:
With this data I then created the following measure:
TotalRevenueActual :=
CALCULATE(
SUM('YourTableName'[Amount]),
'YourTableName'[Account] = "Revenue",
'YourTableName'[Type] = "Actual"
)
The results:
And, -100 is accurate as it is the amount where Account is Revenue and Type is Actual. Hope this helps!
Another option would be in Power Query - you can pivot the data so that Revenue and Expense are two different columns.
Proud to be a Super User! | |
Hi Audreygerred, thanks a lot. it probably will work!
Regards
No problem! Happy to help! Also, I forgot to mention the handling of the negative. I adjusted the DAX below:
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |