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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MP-iCONN
Resolver I
Resolver I

Show visual indicator when field has certain values

I have a table that will have a master item number (Parent Item ID) and then a child part number (Component Item ID).  These are all tied to work orders which is another column in my table.  I am trying to show if I have all my Component Items to build a Parent Items.  I made a column called Comp Short which will show if I have enough of each to make that Parent.  The problem I am facing is how do I indicate if there is one short for my Work Order this means I am basically all short and can't build the item till I have all OK's in that Column per work order.

 

As you see below in my screen shot the first two Work Orders WO43685 and WO43684 are Short and the WO43683 Work Order is OK.  If there is a way to maybe make a new column that will indicate this somehow. 

 

Basically it is easy to see how the first work order is all short (new column would just have WO43685 as short).  The 2nd work order WO43684 has one short but the rest OK, so would need to have new column say Short.  Finally that 3rd work order WO43683 is all OK so new column would indicate that work order is OK.

 

MPiCONN_0-1649332073380.png

 

Thank you for any help on this.

 

1 ACCEPTED SOLUTION

@MP-iCONN,

 

I got it to work by creating a measure instead of a calculated column:

 

Work Order Status = 
VAR vCountShort =
    CALCULATE (
        COUNT ( BOM[Comp Short] ),
        ALLEXCEPT ( WKO, WKO[Work Order ID] ),
        BOM[Comp Short] = "Short"
    )
VAR vResult =
    IF ( vCountShort > 0, "Short", "OK" )
RETURN
    vResult

 

DataInsights_0-1649455430426.png

 





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

Proud to be a Super User!




View solution in original post

6 REPLIES 6
DataInsights
Super User
Super User

@MP-iCONN,

 

Try this calculated column:

 

Work Order Status = 
VAR vCountShort =
    CALCULATE (
        COUNT ( Table1[Comp Short] ),
        ALLEXCEPT ( Table1, Table1[Work Order] ),
        Table1[Comp Short] = "Short"
    )
VAR vResult =
    IF ( vCountShort > 0, "Short", "OK" )
RETURN
    vResult

DataInsights_0-1649436188783.png

 





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

Proud to be a Super User!




For some reason I get "A circular dependency was detected".

 

My "Comp Short" is a calculated column with this in it.

 

Comp Short = IF([Availabe Comp] <= 0,"Short","OK")

 

So not sure if that is the cause.

 

 

@MP-iCONN,

 

You could move the logic in Comp Short to the calculated column I provided. Something like this:

 

Work Order Status =
VAR vCountShort =
    CALCULATE (
        COUNTROWS ( Table1 ),
        ALLEXCEPT ( Table1, Table1[Work Order] ),
        Table1[Available Comp] <= 0
    )
VAR vResult =
    IF ( vCountShort > 0, "Short", "OK" )
RETURN
    vResult

 

If you could provide sample data (table format) and the DAX for any calculated columns, it will be easier to troubleshoot.





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

Proud to be a Super User!




Here is a link to the PBIX if that helps.  It has a sample set of data in it.  The TEST page is what I was working from for now within that PBIX.

 

https://mechanicalproducts-my.sharepoint.com/:u:/g/personal/csullivan_mechprod_com/Ee4BW4aBMcdMq6RMO...

@MP-iCONN,

 

I got it to work by creating a measure instead of a calculated column:

 

Work Order Status = 
VAR vCountShort =
    CALCULATE (
        COUNT ( BOM[Comp Short] ),
        ALLEXCEPT ( WKO, WKO[Work Order ID] ),
        BOM[Comp Short] = "Short"
    )
VAR vResult =
    IF ( vCountShort > 0, "Short", "OK" )
RETURN
    vResult

 

DataInsights_0-1649455430426.png

 





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

Proud to be a Super User!




That appears to have helped get what I need.  I had to remove all columns except Work Order and the new measure you helped create but this will for sure work.  Thank you for all your help on this!

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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