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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sfaizee
Helper I
Helper I

Need help to correct averageA formula.

Hi Everyone,

I am very new to DAX and i need help to resolve this problem i am facing with dax. 

I have a table for which i want to calculate the average values.

My measure details are as below:

 

Total price for setup =
CALCULATE(
    AVERAGEA('2012'[Total price]),
    FILTER('2012','2012'[Activity Text STD]="setup"),
    FILTER('2012','2012'[PrI]="5")
)
Note: These 2 filters are on 2 seperate coloumns on the sheet. 
When i use only one filter i am getting the result. But i need both the filters to work. 
Please help. 
Thanks.
 
 
 
 
The syntax is right (no errors). 
But the result of this measure is not showing in the card. 
It gives me an error:
 "Cant display the visual"
 
 
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@sfaizee 

 

Why do you use AVERAGEA? and "5"


Try your measure this way:

Total price for setup = 
CALCULATE(
    AVERAGE('2012'[Total price]),
    
    FILTER( 
         ALL('2012''2012'[Activity Text STD], '2012','2012'[PrI]),
        '2012'[Activity Text STD]="setup" && '2012','2012'[PrI]=5
    )
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @sfaizee ,

  • The AVERAGEA function takes a column and averages the numbers in it, but also handles non-numeric data types according to the following rules:

    • Values that evaluates to TRUE count as 1.
    • Values that evaluate to FALSE count as 0 (zero).
    • Values that contain non-numeric text count as 0 (zero).
    • Empty text ("") counts as 0 (zero).
  • If you do not want to include logical values and text representations of numbers in a reference as part of the calculation, use the AVERAGE function.

  • Whenever there are no rows to aggregate, the function returns a blank. However, if there are rows, but none of them meet the specified criteria, the function returns 0.

Based on your description, not certain what is your expected output, you can try to use average function as @ AlB mentioned to test. Basically need more information like some sample data, expected output or screenshots etc. for further discussion.

 

Best Regards,
Yingjie Li

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

Fowmy
Super User
Super User

@sfaizee 

 

Why do you use AVERAGEA? and "5"


Try your measure this way:

Total price for setup = 
CALCULATE(
    AVERAGE('2012'[Total price]),
    
    FILTER( 
         ALL('2012''2012'[Activity Text STD], '2012','2012'[PrI]),
        '2012'[Activity Text STD]="setup" && '2012','2012'[PrI]=5
    )
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

AlB
Community Champion
Community Champion

Hi @sfaizee 

1.What else does the error message say?

2. Can you share the pbix or at least show a sample of your table(s)?

3. Are you just using this measure in a card or do you have something else in the report (slicers, etc.)?

4. Why are you using AVERAGEA( )  instead of AVERAGE( )?

5. Is PrI a column of type number or text?

Try this:

 

 

 

Total price for setup =
CALCULATE(
    AVERAGE('2012'[Total price]),
    '2012'[Activity Text STD]="setup",
    '2012'[PrI]=5
)

 

 

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.