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
Anonymous
Not applicable

Create new column or measure

I am having trouble figuring out the best way to do this task. 

 

I have 18 duplicate pm_id for a task and if any of those 18 fail in the value column then the whole thing fails.  Would it be best to create a new column or a measure?  Any help would be appreciated.

 

ghe7549_0-1642795894275.png

 

 

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous,

 

How you intend to use this field will help you determine which approach to use. If you need to slice on this field in a visual (or use it in a slicer), a calculated column will enable you to do so. Here's the DAX for a calculated column:

 

result = 
IF (
    CALCULATE (
        COUNT ( Table1[pm_template_task_id] ),
        ALLEXCEPT ( Table1, Table1[pm_id] ),
        Table1[value] = "Fail"
    ) > 0,
    "Fail",
    "Pass"
)

 

DataInsights_0-1642950513618.png

 





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
DataInsights
Super User
Super User

@Anonymous,

 

How you intend to use this field will help you determine which approach to use. If you need to slice on this field in a visual (or use it in a slicer), a calculated column will enable you to do so. Here's the DAX for a calculated column:

 

result = 
IF (
    CALCULATE (
        COUNT ( Table1[pm_template_task_id] ),
        ALLEXCEPT ( Table1, Table1[pm_id] ),
        Table1[value] = "Fail"
    ) > 0,
    "Fail",
    "Pass"
)

 

DataInsights_0-1642950513618.png

 





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

Proud to be a Super User!




Anonymous
Not applicable

How would i go about only counting the results for only one PM_ID instead of getting a count of say 4 fails for pm_id 7e54?

@Anonymous,

 

Would you provide an example of the desired result?





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

Proud to be a Super User!




Anonymous
Not applicable

Here is what i came up with for the measure:
Pass/Fail Count =
CALCULATE(
DISTINCTCOUNT(Query1[pm_id]),
SUMMARIZE(
Query1,
Query1[result]
)
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.