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

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.

Reply
jeroenwmwillems
Advocate I
Advocate I

Return value with certain conditions, if another condition is true

Hi all,

 

I'm trying to get PowerBI to do something with a formula that's a bit over my head, was hoping you'd be able to help:

I want to have a column in my file, which returns a value for a specific user, that is dependant on some other conditions. To make it clearer, I made the example file below. 

I'd like to return the colour a user had, when they ordered the first time, to be returned in 'column wanted'.

So the formula would have to do the following things: 

Match the user ID with the User ID in the row, and then confirm that first time = yes. For the value where this is true, it should return the colour in the 'column wanted'. So practically, in this example, all rows for 'User 2' would have 'Red' in the 'column wanted'.

 

Any help is much appreciated!

 

 
 

examplefile.PNG

1 ACCEPTED SOLUTION
Nathaniel_C
Community Champion
Community Champion

Hi @jeroenwmwillems ,

 

measure =
CALCULATE (
    MAX ( table[Colour] ),
    ALLEXCEPT ( table, table[USER] ),
    table[First Time] = "Yes"
)

 

Try this.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Nathaniel_C
Community Champion
Community Champion

Hi @jeroenwmwillems ,

 

measure =
CALCULATE (
    MAX ( table[Colour] ),
    ALLEXCEPT ( table, table[USER] ),
    table[First Time] = "Yes"
)

 

Try this.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks Nathaniel, works like a charm.

 

You're a champ! @Nathaniel_C 

Thank you, you are welcome!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Nathaniel_C
Community Champion
Community Champion

Hi @jeroenwmwillems ,

Would you copy and paste the data instead of a picture, so we create a pbix? Thank you, Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.