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
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
- MP-iCONN4 years agoResolver I
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.
- DataInsights4 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 vResultIf you could provide sample data (table format) and the DAX for any calculated columns, it will be easier to troubleshoot.
- MP-iCONN4 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.