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
SylwekGr
New Member

Using measure value as compare value

HI, I need your help

In brief I have table:

PowerBi-table.PNG

In Report view I have filtered table by "class" with Average score for filteres values

PowerBi-report.PNG

 

How can I get "second average score" depends on value greater than "Average Score" as Minimum value for filtered table.

Example:

Rows left that match to "Avererage Score" as Minimum value:

name      | score     | age  | class

------------------------------------

Eva          | 35          | 20    | a

------------------------------------

Jan          | 20          | 20    | a

------------------------------------

Michael   | 20          | 29    | a

 

Result for "Second Average Score" will be 25

 

2 ACCEPTED SOLUTIONS
AlB
Super User
Super User

Hi @SylwekGr 

 

Average Score 2 =
VAR Ref_ = [Average score]  // The measure you currently have
RETURN
    AVERAGEX ( FILTER ( 'Table', 'Table'[Score] > Ref_ ), 'Table'[Score] )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

    

View solution in original post

jdbuchanan71
Super User
Super User

Hello @SylwekGr 

This gave me the expected result.

Average above Average = 
VAR _Avg = CALCULATE ( [Average Score], ALLSELECTED ( 'Table' ) )
RETURN
AVERAGEX(
    FILTER ( VALUES ( 'Table'[name] ), [Average Score] > _Avg ),[Average Score] )

AvgAboveAvg.jpg

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

Hello @SylwekGr 

This gave me the expected result.

Average above Average = 
VAR _Avg = CALCULATE ( [Average Score], ALLSELECTED ( 'Table' ) )
RETURN
AVERAGEX(
    FILTER ( VALUES ( 'Table'[name] ), [Average Score] > _Avg ),[Average Score] )

AvgAboveAvg.jpg

AlB
Super User
Super User

Hi @SylwekGr 

 

Average Score 2 =
VAR Ref_ = [Average score]  // The measure you currently have
RETURN
    AVERAGEX ( FILTER ( 'Table', 'Table'[Score] > Ref_ ), 'Table'[Score] )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

    

Hi @AlB @jdbuchanan71 

Both solutions works perfect 🙂

thx for quick reply

 

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