Forum Discussion

NDG's avatar
NDG
Frequent Visitor
4 years ago
Solved

Average based on columns

Good day,

 

 Will need help as I’m new with DAX. How I can get average measure based on measure output whereas condition to be used different columns entries.

 

Exs.

 

Table 1 as condition to be Sales Product Category

Table 2 as condition to be Plant

Table 3 as condition to be Order date

And average to be from Measure from Table 3.

 

Table 1     Table 2         Table 3             Measure

Film            ANT            9/1/21                     3

Film            BTM           9/1/21                      4

Paper         ANT            9/1/21                      5

 Film            ANT           9/3/21                     5              

 

Thank you all for your support 

 

 

  • Hi NDG ,

    You can try this measure to calculate the average:

    Average = 
    VAR tab =
        SUMMARIZE (
            'Table 1',
            'Table 1'[Sales Product Category],
            'Table 2'[Plant],
            'Table 3'[Order date],
            "A", [Measure]
        )
    RETURN
        AVERAGEX ( tab, [A] )

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

3 Replies

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi NDG ,

    You can try this measure to calculate the average:

    Average = 
    VAR tab =
        SUMMARIZE (
            'Table 1',
            'Table 1'[Sales Product Category],
            'Table 2'[Plant],
            'Table 3'[Order date],
            "A", [Measure]
        )
    RETURN
        AVERAGEX ( tab, [A] )

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Power BI visuals have built-in aggregations - measures are not required.