Forum Discussion
MP-iCONN
4 years agoResolver 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 try...
- 4 years ago
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
4 years agoSuper User
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.
MP-iCONN
4 years agoResolver I
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.
- DataInsights4 years agoSuper User
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- MP-iCONN4 years agoResolver I
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!