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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
saikrish_01
Frequent Visitor

How to calculate a measure based on another measure.

Hi.

 I have a table like the below.

ClassSectionStudentsMarks
1ANick87
1AJones83
1ASmith80
1BWill92
1BSmith90
1BRock65
1CJames50
1CAnderson65
1CWalker79
2APaul56
2APeter32
2AParker95
2BGrame81
2BSmith87
2BWalter72
2CWhite67
2CJesse54
2CPinkman11

 

I used a simple average measure to calculate the average of each section in all classes.

I need to create another measure which counts the number of sections in a class having average more than 60.

 

I hope my doubt is clear.

Kindly help me with the DAX Measure for the above.

 

Thanks 🙂

1 ACCEPTED SOLUTION
some_bih
Super User
Super User

Hi @saikrish_01 ,

I insert your data into Excel; Sheet3 name you should adjust according your names. I hope this help

Avg measure: 

Ave Se =
AVERAGEX ( Sheet3, [Marks] )
Second measure:

# Sect higher 60 =
VAR _value=60
VAR _sectionswithAvg=
    ADDCOLUMNS(SUMMARIZE(
        Sheet3,
        Sheet3[Class],
        Sheet3[Section]),
        "@AvgSec", [Ave Se]
    )
VAR _fitlered_table=
    FILTER(
        _sectionswithAvg,
        [@AvgSec]>_value
    )
RETURN
--number of section above threshold
COUNTROWS(_fitlered_table)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






View solution in original post

2 REPLIES 2
saikrish_01
Frequent Visitor

Thanks so much for helping me out. it worked !!!! 🙂

 

some_bih
Super User
Super User

Hi @saikrish_01 ,

I insert your data into Excel; Sheet3 name you should adjust according your names. I hope this help

Avg measure: 

Ave Se =
AVERAGEX ( Sheet3, [Marks] )
Second measure:

# Sect higher 60 =
VAR _value=60
VAR _sectionswithAvg=
    ADDCOLUMNS(SUMMARIZE(
        Sheet3,
        Sheet3[Class],
        Sheet3[Section]),
        "@AvgSec", [Ave Se]
    )
VAR _fitlered_table=
    FILTER(
        _sectionswithAvg,
        [@AvgSec]>_value
    )
RETURN
--number of section above threshold
COUNTROWS(_fitlered_table)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.