Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi everyone,
I'd like to value from my fact table negative if a field from a dimension table has a certain value.
For exemple :
If ('Dimension Type'[Type] = "A", SUM('Fact sales'[Amount] * -1, IF('Dimension Type'[Type] = "B", SUM('Fact sales'[Amount]))
Both tables are linked of course.
Can you tell me how I can do that?
Thank you in advance.
Solved! Go to Solution.
@Tybaal , something like this
if (max('Dimension Type'[Type]) = "A", SUM('Fact sales'[Amount]) * -1, IF('Dimension Type'[Type] = "B", SUM('Fact sales'[Amount])))
or
sumx(values('Dimension Type'[Type]) ,if ('Dimension Type'[Type] = "A", SUM('Fact sales'[Amount]) * -1, IF('Dimension Type'[Type] = "B", SUM('Fact sales'[Amount]))))
@Tybaal , something like this
if (max('Dimension Type'[Type]) = "A", SUM('Fact sales'[Amount]) * -1, IF('Dimension Type'[Type] = "B", SUM('Fact sales'[Amount])))
or
sumx(values('Dimension Type'[Type]) ,if ('Dimension Type'[Type] = "A", SUM('Fact sales'[Amount]) * -1, IF('Dimension Type'[Type] = "B", SUM('Fact sales'[Amount]))))
Thank you @amitchandak , it works with your first proposition :
if (max('Dimension Type'[Type]) = "A", SUM('Fact sales'[Amount]) * -1, IF(max('Dimension Type'[Type] = "B", SUM('Fact sales'[Amount])))
But can you explain why it didn't work without the 'max'? (sorry i'm a beginner in DAX)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 73 | |
| 50 | |
| 46 | |
| 44 |