Forum Discussion

Sarath5c8's avatar
Sarath5c8
Frequent Visitor
2 years ago
Solved

required Delta of data

I need the delta of the data as the result  when the table has  ID Parent Child 1 P1 C1 1 P1 C2 1 P1 C3 1 P2 C7 1 P2 C2 1 P2 C3 2 P3 C1 2 P3 C4 3 P4...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Sarath5c8 ,

    The Table data is shown below:

    Please follow these steps:
    1. Use the following DAX expression to create a measure

    MEASURE =
    VAR _ChildCount =
        CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table'[Parent] ) )
    VAR _ParentCount =
        CALCULATE (
            COUNTROWS ( SUMMARIZE ( 'Table', 'Table'[ID], 'Table'[Parent] ) ),
            ALLEXCEPT ( 'Table', 'Table'[ID] )
        )
    RETURN
        IF ( _ParentCount = 1, BLANK (), IF ( _ChildCount <> 1, BLANK (), "" ) )
    

    2.Final output

     

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