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 with specific conditions

Hi there,

 

I am just starting to discover PowerBI and it looks promising but I am stuck with a specific problem. I'd like to make a trend analysis for several different regions over four years and with multiple products.

Calculating the averages for all the products and seeing how they develop over time is not very difficult, however, I would like to select ONLY the regions which have provided me with information in all four years. 

 

So: How can I make a select the regions that have given me data over all four years and for each specific product?

 

I currently only have a table with all data, including the four years, all the regions and all different products and related prices.

 

I am looking forward to hearing from you, if any additional information is required, please let me know.

 

Best regards,

 

Floris

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

It is not clear of your information, before you provide more details, i would like to give two methods as below.

with this measure, i can calcuate how many years each region give the information

measure-region = CALCULATE(DISTINCTCOUNT(Sheet6[year]),ALLEXCEPT(Sheet6,Sheet6[regions]))

with this measure,   i can calcuate how many years each product give the information

Measure-each product = CALCULATE(DISTINCTCOUNT(Sheet6[year]),ALLEXCEPT(Sheet6,Sheet6[products]))

3.png

 

For next steps, please let me know what exactly you want.

 

Best Regards

Maggie

Greg_Deckler
Super User
Super User

Several different ways to accomplish this, report, page or visual level filters, using AVERAGEX with an appropriate FILTER clause. If you want this to be dynamic, that will take a little more work but could be accomplished using a temporary table and IN most likely. But, that would need sample data to be specific. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.