Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
bml123
Post Patron
Post Patron

Totals incorrect with measure

Hi,

 

I have data like this

 

IdAmountFlag
110Yes
220No
330Yes
440No
550Yes
Total150 

 

Amount and Flag are measures. I want to have other columns ValueswithYES, ValueswithNO and totals like this

 

 IdAmountFlagValueswithYESValueswithNO
 110Yes10 
 220No 20
 330Yes30 
 440No 40
 550Yes50 
Total 150Yes9060

 

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?

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

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!

View solution in original post

4 REPLIES 4
CNENFRNL
Community Champion
Community Champion

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!

bml123
Post Patron
Post Patron

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'?






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



ChrisMendoza
Resident Rockstar
Resident Rockstar

@bml123 - try as:

ValueswithYes Measure = 
CALCULATE(
    [Amount Measure],
    TableName[Flag] = "Yes"
)

ValueswithYes Measure = 
CALCULATE(
    [Amount Measure],
    TableName[Flag] = "No"
)

 

image.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors