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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
tomtang
Helper III
Helper III

Query Plan become slower when applying Visual level filter

Dear all Power BI Guru,

 

I am creating a ranking measure which can dynamically identify TopN sales by client.

 

My measure is working fine, however, when I apply the ranking measure in the visual level filter, it slows down all the query plan.

 

My question is there any way to enhance it?

 

Attached is my reproduced PBIX file using Contoso dataset.

https://1drv.ms/u/s!AuELRdj9xWWta0xJfF6rRXOYcQ4?e=YW9UPf

(I know with Contoso dataset the variance is very minimum, but my real report has more data point and more measure in the matrix, so the difference is quite noticeable)

Below are the snapshots for the illustration.

 

Snapshot 1: I apply the Ranking measure in visual level filter

tomtang_0-1610070438919.png

 

Snapshot 2: I run the Performance Analyzer to get query plan

tomtang_1-1610070484525.png

 

Snapshot 3: I try to analyze the Server Timings with/without "__valueFilterDM3", which is the query reflecting ranking measure in visual level filter

tomtang_2-1610070537852.png

 

Snapshot 4: Server Timings without visual level filter 

tomtang_3-1610070661592.png

 

Snapshot 5: Server Timings with visual level filter, which is slower than without the filter

tomtang_4-1610070666254.png

 

5 REPLIES 5
v-eqin-msft
Community Support
Community Support

Hi @tomtang ,

 

From my test, replacing [Sales Amount] with [SalesAmount] field in the original table could slightly reduce the query time.

1.12.4.1.gif

 

In addition, you could try to use OPTIMIZEDAX() function

 

 

Hope these help.

https://docs.microsoft.com/en-us/power-bi/guidance/power-bi-optimization

https://docs.microsoft.com/en-us/learn/modules/optimize-model-power-bi/

https://maqsoftware.com/expertise/powerbi/dax-best-practices

https://powerpivotpro.com/2019/03/dax-optimizations-write-it-like-the-dax-calls-it/

 

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

Thanks @v-eqin-msft for answering!

I will try it out later with your approach.

 

p.s. I do hope the OPTIMIZEDAX is real.😅

tomtang
Helper III
Helper III

Dear all,

 

Any recommandation? Thank you!

 

Tom

Gabriel_Walkman
Continued Contributor
Continued Contributor

Sorry if this is a stupid question, but could you just use a Top N visual level filter without a separate measure?

Hi Gabriel,

 

In order to make it dynamic, I have to use this approach.

 

Thanks for response!

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors