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
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
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