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,
I have data like this
| Id | Amount | Flag |
| 1 | 10 | Yes |
| 2 | 20 | No |
| 3 | 30 | Yes |
| 4 | 40 | No |
| 5 | 50 | Yes |
| Total | 150 |
Amount and Flag are measures. I want to have other columns ValueswithYES, ValueswithNO and totals like this
| Id | Amount | Flag | ValueswithYES | ValueswithNO | |
| 1 | 10 | Yes | 10 | ||
| 2 | 20 | No | 20 | ||
| 3 | 30 | Yes | 30 | ||
| 4 | 40 | No | 40 | ||
| 5 | 50 | Yes | 50 | ||
| Total | 150 | Yes | 90 | 60 |
I have used measures like this ValueswithYES = if(Flag="Yes",[Amount]), getting the values right but the total I am getting as 150 which is incorrect. How do I achieve this?
Solved! Go to Solution.
Values w/ YES = SUMX(VALUES(DATA[ID]),IF([Flag]="YES",[Amount]))
Values w/ NO = SUMX(VALUES(DATA[ID]),IF([Flag]="NO",[Amount]))
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Values w/ YES = SUMX(VALUES(DATA[ID]),IF([Flag]="YES",[Amount]))
Values w/ NO = SUMX(VALUES(DATA[ID]),IF([Flag]="NO",[Amount]))
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
That didn't work. My Flag is also measure.
Getting this error A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
What is the measure for 'Flag'?
Proud to be a Super User!
@bml123 - try as:
ValueswithYes Measure =
CALCULATE(
[Amount Measure],
TableName[Flag] = "Yes"
)
ValueswithYes Measure =
CALCULATE(
[Amount Measure],
TableName[Flag] = "No"
)
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 |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |