cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PBIX123 Frequent Visitor
Frequent Visitor

How to optimize a measure with multiple filters

Hi All, 

 

I have several measures that are similar to this format:

 

CALCULATE(

           DISTINCTCOUNT(PRODUCT[Product_ID]),

           FILTER(

                      SALES,

                      SALES[Revenue]>100 &&

                      RELATED(PRODUCT[Product_Color])="Red"

                     )

                   )

 

In this case, Product is the one-side of the table and Sales is the many side of the table. Some other conditions:

1. the filters can have more && and || operator.

2. comparing values of different columns instead of given value (e.g. "Red", 100 in the example above).

 

The issue I am having is it takes forever to calculate the measure when I display it in table format, drilled down to each Product_Id in this case. the total data points is in ~100,000. I am using Azure AS and it is still running our of memory from time to time due to these measures. Wondering if there is a better way to optimize it? Thank you in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions
PBIX123 Frequent Visitor
Frequent Visitor

Re: How to optimize a measure with multiple filters

Found a solution! 

View solution in original post

1 REPLY 1
PBIX123 Frequent Visitor
Frequent Visitor

Re: How to optimize a measure with multiple filters

Found a solution! 

View solution in original post

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors