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

Table with TOP 50 for measure is very slow

I have a table with the values "disease" and "filtered patient table".  Filter Patient Table is a measure.  This measure is defined as 

FILTERED PATIENTS TABLE = COUNTROWS(PATIENT).  When the the table is filtered to DISEASE top 50 by FILTER PATIENT TABLE, the dashboard is really slow to load the first time.  It takes around 30 seconds.  I'm trying to figure out how to make this faster.  Here is the DAX I pulled from the performance analyzer.
 
powerbi.PNG
 
 

DEFINE
MEASURE 'PATIENT'[FILTERED PATIENTS TABLE] =
(/* USER DAX BEGIN */
COUNTROWS(PATIENT)
/* USER DAX END */)

VAR __ApplyFilterSQDS0 =
TOPN(
50,
SUMMARIZECOLUMNS(
'Diagnosis'[disease],
"FILTERED PATIENTS TABLE", 'PATIENT'[FILTERED PATIENTS TABLE]
),
[FILTERED PATIENTS TABLE],
0
)

EVALUATE
TOPN(
501,
SUMMARIZECOLUMNS(
'Diagnosis'[disease],
__ApplyFilterSQDS0,
"FILTERED PATIENTS TABLE", 'PATIENT'[FILTERED PATIENTS TABLE]
),
'Diagnosis'[disease],
0
)

ORDER BY
'Diagnosis'[disease] DESC

 

Please help!

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi

Please create the following measures:

Ranks = rankx(all(patient[disease]),[FILTERED PATIENTS TABLE])
top 50 := IF(Ranks <= 50,[FILTERED PATIENTS TABLE])

Remove your top 50 from the visual filter

Substitute measure FILTERED PATIENTS TABLE from the visual values with the top 50 and let me know if that improved.

 

If I answer your question, please mark my post as a solution, this will also help others.
Please give Kudos for support.

Tomas Santandreu Polanco |Principal Business Intelligence Consultant
www.designmind.com

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi

Please create the following measures:

Ranks = rankx(all(patient[disease]),[FILTERED PATIENTS TABLE])
top 50 := IF(Ranks <= 50,[FILTERED PATIENTS TABLE])

Remove your top 50 from the visual filter

Substitute measure FILTERED PATIENTS TABLE from the visual values with the top 50 and let me know if that improved.

 

If I answer your question, please mark my post as a solution, this will also help others.
Please give Kudos for support.

Tomas Santandreu Polanco |Principal Business Intelligence Consultant
www.designmind.com

 

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.

Top Solution Authors