Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Group by Dax functions

Hi,   I have data that looks like this:    Brown colored are input columns Blue colored are output column   Anchor Config ID Target Config ID Dealer (of target config ID) Enabled for...
  • Icey's avatar
    6 years ago

    Hi Anonymous ,

    Try this:

    Enabled for requested dealer = 
    VAR CurrentAnchor = 'Table'[Anchor Config ID]
    VAR CurrentAnchorDealer =
        CALCULATE ( MAX ( 'Table'[Dealer] ), CurrentAnchor = 'Table'[Target Config ID] )
    VAR CountOfTargetDealer =
        CALCULATE (
            COUNT ( 'Table'[Target Config ID] ),
            ALLEXCEPT ( 'Table', 'Table'[Anchor Config ID], 'Table'[Target Config ID] )
        )
    RETURN
        IF (
            CurrentAnchorDealer <> BLANK (),
            "Yes",
            IF ( CountOfTargetDealer >= 2 && CurrentAnchorDealer = BLANK (), 
            "Yes", 
            "No" )
        )
    # of dealers target config mapped to =
    CALCULATE (
        COUNT ( 'Table'[Target Config ID] ),
        ALLEXCEPT ( 'Table', 'Table'[Anchor Config ID], 'Table'[Target Config ID] )
    )

     

    Best Regards,

    Icey

     

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