Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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.
Thank you for any help on this.
Solved! Go to Solution.
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
Proud to be a Super User!
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
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.
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.
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.
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
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!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
77 | |
74 | |
57 | |
40 | |
33 |
User | Count |
---|---|
70 | |
63 | |
57 | |
49 | |
46 |