Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Average of Two columns by adding the second Column First row to the First Column

Hi Team,   I tried differet ways to get Average for the below data but was not possible to get the Dax foumula. Could some one help me in cracking this problem.   I have two columns named Checkin...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi,

    Thanks for the solution freginier  and MFelix  offered, and i want to offer some more information for user to refer to.

    hello Anonymous , you can refer to the follwing solution.

    Sample data:

     

    Create a measure

    MEASURE =
    VAR a =
        CALCULATETABLE (
            DISTINCT ( 'Table'[First date min] ),
            FILTER ( ALLSELECTED ( 'Table' ), [End MY] IN VALUES ( 'Table'[End MY] ) )
        )
    VAR b =
        SELECTCOLUMNS (
            FILTER ( ALLSELECTED ( 'Table' ), [End MY] IN VALUES ( 'Table'[End MY] ) ),
            "Test", [Chencking]
        )
    RETURN
        AVERAGEX ( UNION ( a, b ), [First date min] )
    

    Then create a measure and put the following field to it.

     

    Output

     

     

    Best Regards!

    Yolo Zhu

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

     

  • Anonymous's avatar
    Anonymous
    1 year ago

    Anonymous  Thank you soo much.. This is how i wanted the soultion.. Big kudos to you