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

How to make another table using DAX with some conditions

Hi team

 

I have one table like below -

 

RatanBhushan_0-1630566827684.png

 

I want to create another calculated table like below-

RatanBhushan_1-1630566857216.png

 

In above table - I want another column showing the count of Pass/Fail accourding to given in DAX. How to get that column?

 

Please help.

 

@amitchandak Could you please look and help me.

 

Thanks and regards

RatanB

5 REPLIES 5
Anonymous
Not applicable

I am trying below but not happening - 

 

RatanBhushan_0-1630567031728.png

 

 

Please advise

Try:

CountPassFail =
ADDCOLUMNS (
    SUMMARIZE ( Data, Data[Region], Data[Sites], Data[Month] ),
    "Fail", CALCULATE ( COUNT ( Data[Status] ), Data[Status] = "Fail" ),
    "Pass", CALCULATE ( COUNT ( Data[Status] ), Data[Status] = "Pass" )
)




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Thank you so much @PaulDBrown. it worked.

Could you please advise - incase I want to make separate measure in CountPassFaill Table -then why the same extract from count is not working?

The calculated column doesn't work because there is no filter context coming from the original table because they are not related. So the code in the new table is not identifying the context for the fields region, site and month from the original table. You can solve this by either creating dimension tables or using the TREATAS function.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






HI @Anonymous 

 

Can you share sample of your data here to be able to copy that? NOT IN IMAGE TYPE 🙂

Appreciate your Kudos !

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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