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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

If Then with two arguments(columns) then return fail or pass

Greetings,

I need to perform a DAX calculation that looks at columns C and D and if they are over a certain number then a return colum should say 'Fail' otherwise 'Pass". The problem I am having is that my report keep on suggesting key measures instead of the actual table and column. When I just type the table with the colum i.e. 'Table'['results'] or 'Table'[results]. The program doesnt like it and gives me an error. I thought it was because the C and D columns were sum but that is not the case. Thanks in advance.

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

Please show us your data and the DAX you are trying to write.  Really hard to see the issue without them.

That said, I'm guessing that you are might be trying to write a measure and DAX is telling you that you need to provide an aggregation for the column.

Also, is it a Fail if both C and D are over a certain number, or is it just one or the other over a certain number?

If you are writing DAX to create a column it could look like this which produces Fail if both C and D are over 20.  Adjust as required.

Result = IF([C] > 20 && [D] > 20, "Fail", "Pass")

pf2.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks again.

 

Anonymous
Not applicable

Hi @Anonymous ,

 

If it is to calculate the sum of metrics, you can use the SUMX function.

SUMX(<table>, <measure>)  

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

Please show us your data and the DAX you are trying to write.  Really hard to see the issue without them.

That said, I'm guessing that you are might be trying to write a measure and DAX is telling you that you need to provide an aggregation for the column.

Also, is it a Fail if both C and D are over a certain number, or is it just one or the other over a certain number?

If you are writing DAX to create a column it could look like this which produces Fail if both C and D are over 20.  Adjust as required.

Result = IF([C] > 20 && [D] > 20, "Fail", "Pass")

pf2.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.