Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SEPA
Frequent Visitor

calculate average from calculated measure

Dear Experts,

I have data like below,

 

countrylevelstagetargetactualstage actual avglevel actual avgcountry actual avg 
spainlvl1stg113274585345.60%229.11%115.55% 
spainlvl1stg213271494112.61%229.11%115.55% 
singaporelvl2stg9166700.00%0.00%115.55% 
germanylvl3stg510131516149.61%117.53%115.55% 
germanylvl3stg6101386685.46%117.53%115.55% 

I was able to achieve the average of stage and level measure but for country average i am getting different average values.

stage average = average of Arch by stage

level average = average of (stage average) by level

country average = avergae of (level average) by country - this measure is not giving correct vaue. i am getting 138.

 

Please help

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1663313948382.png

 

 

Country avg: =
AVERAGEX (
    ADDCOLUMNS (
        FILTER (
            SUMMARIZE ( ALL ( 'Table' ), 'Table'[COUNTRY], 'Table'[LEVEL] ),
            'Table'[COUNTRY] = MAX ( 'Table'[COUNTRY] )
        ),
        "@levelavg", [Level avg:]
    ),
    [@levelavg]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1663313948382.png

 

 

Country avg: =
AVERAGEX (
    ADDCOLUMNS (
        FILTER (
            SUMMARIZE ( ALL ( 'Table' ), 'Table'[COUNTRY], 'Table'[LEVEL] ),
            'Table'[COUNTRY] = MAX ( 'Table'[COUNTRY] )
        ),
        "@levelavg", [Level avg:]
    ),
    [@levelavg]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you it works as expected

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.