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
Anonymous
Not applicable

Average %

Captura.PNG

I need to average the column CONFIABILIDAD [column calculadted: New Measure] (Picture 2) excluding the column META (Picture 1). The formula DAX (Picture 4) that I am using is averaging everything (it is not excluding the column META) and the "wrong" result is 81.83% (Picture 3). The correct answer should be 96.67%. I appreciate the help

 

 

 

2 ACCEPTED SOLUTIONS
AnkitBI
Solution Sage
Solution Sage

Please try something like below, using filter to exclude product not required. 

 

Measure 7 = AVERAGEX(KEEPFILTERS(filter(values('Product'[Category]),'Product'[Category] <> "Bikes")),CALCULATE([Measure 5]))

Regards,

AJ

Do Like Post if response seems good and Worth liking.

Do Mark as Solution if response resolved your Issue.

View solution in original post

Actaully, Didn't get time to add few things yesterday.

 

1) You don't need KeepFilters here. As per PBI Docs, KeepFilter is only required with Calculate and CalculateTable to keep context from changing.

KeepFilters

2) When using a Measure inside Aggregate function, you don't need to add Calculate function. Don't have an exact theory however as per my understanding, using Measure an internal/default Calculate is automatically added.

 

Regards
AJ

View solution in original post

4 REPLIES 4
AnkitBI
Solution Sage
Solution Sage

Please try something like below, using filter to exclude product not required. 

 

Measure 7 = AVERAGEX(KEEPFILTERS(filter(values('Product'[Category]),'Product'[Category] <> "Bikes")),CALCULATE([Measure 5]))

Regards,

AJ

Do Like Post if response seems good and Worth liking.

Do Mark as Solution if response resolved your Issue.

Actaully, Didn't get time to add few things yesterday.

 

1) You don't need KeepFilters here. As per PBI Docs, KeepFilter is only required with Calculate and CalculateTable to keep context from changing.

KeepFilters

2) When using a Measure inside Aggregate function, you don't need to add Calculate function. Don't have an exact theory however as per my understanding, using Measure an internal/default Calculate is automatically added.

 

Regards
AJ

Anonymous
Not applicable

Thanks AnkitBI,
I did it without using KeepFilters and it worked perfectly. Very thankful

Anonymous
Not applicable

Thank AnkitBI,

Excellent!!

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.