Forum Discussion

Infinifox's avatar
Infinifox
Frequent Visitor
1 year ago
Solved

Help with counting rows based on conditions

Hi Everyone,    I have a problem that I need help with. What I am trying to do is have 2 counts that can also be displayed within a table with these fields Work Order, Work Order Phase, Asset Tag, ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Infinifox ,

    I create three tables as you mentioned.

    Then I think you can create a measure and here is the DAX code.

    Measure = 
    VAR SystemAssets =
        FILTER ( Asset, Asset[assetType] = "System" )
    VAR ChildAssets =
        CALCULATETABLE (
            SUMMARIZE ( ChildAsset, ChildAsset[childAssetTag], ChildAsset[assetTag] ),
            SystemAssets
        )
    RETURN
        COUNTROWS ( SystemAssets )

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.