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
MBreden
Helper I
Helper I

Need help with the calculation of averages

Hi all,
I have a table with retailers, categories and values.

MBreden_4-1685025942923.png

To calculate the percentage of categories per retailer, I am using a measure from this forum.

MBreden_5-1685026000889.png

Ret % =

Var _N1=[TT Sum]

Var _N2=CALCULATE(SUM(Data[Value]),FILTER(ALL(Data),[Retailer]=SELECTEDVALUE(DimRetailer[Retailer])))

Return

DIVIDE(_N1,_N2)

 

Now I am still at a loss how to calculate the average of all retailers per category from the result of the measure.

MBreden_3-1685025933016.png 

Any help is appreciated!

1 ACCEPTED SOLUTION

Hi @v-rongtiep-msft ,

This is exactly what I was looking for, thank you so much!
I have adjusted the formula with AVERAGEX and the results are perfect.

 

Measure = 

VAR _1 =

    SUMMARIZE ( DimRetailer, DimRetailer[Retailer], "aaa", [Ret %] )

RETURN

    IF ( ISINSCOPE ( DimRetailer[Retailer] ), [Ret %], AVERAGEX( _1, [aaa] ) )

View solution in original post

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @MBreden ,

Please have a try.

Create another measure.

Measure =
VAR _1 =
    SUMMARIZE ( DimRetailer, DimRetailer[Retailer], "aaa", [Ret %] )
RETURN
    IF ( ISINSCOPE ( DimRetailer[Retailer] ), [Ret %], SUMX ( _1, [aaa] ) / 4 )

vrongtiepmsft_0-1685328059552.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

Hi @v-rongtiep-msft ,

This is exactly what I was looking for, thank you so much!
I have adjusted the formula with AVERAGEX and the results are perfect.

 

Measure = 

VAR _1 =

    SUMMARIZE ( DimRetailer, DimRetailer[Retailer], "aaa", [Ret %] )

RETURN

    IF ( ISINSCOPE ( DimRetailer[Retailer] ), [Ret %], AVERAGEX( _1, [aaa] ) )

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.

Top Solution Authors