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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ji
Regular Visitor

create boolean out of status column with one status relevant

Hello,

I'm trying to create a new dimension in the form of a boolean value. 

The table looks like the following:

cart_idpayment_status
1pending
1authorised
1captured
2pending
2failed

 

with the additional column "success" I wish to mark all "cart_id" with '1' if their payment was authorised and all others with '0'.

The challenge is that one cart_id can have many other payment_status but the only one I care for is "authorised". 

cart_idpayment_statussuccess
1pending1
1authorised1
1captured1
2pending0
2pending0

 

Would be super happy for any advise on how to create this dimension in Power BI

 

Thanks in advance

1 REPLY 1
PaulOlding
Solution Sage
Solution Sage

This calculated column DAX counts the number of times a cart is authorised.  If any number is returned then the column is set to 1, otherwise 0.

 

Success =
VAR _AuthorisedCount =
CALCULATE(
COUNTROWS('Table'),
ALLEXCEPT('Table', 'Table'[cart_id]),
'Table'[payment_status] = "Authorised"
)
VAR _Result = IF(_AuthorisedCount, 1, 0)
RETURN
_Result

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.