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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Measure optimization for fast visual rendering

Hi Guys,

 

I have a measure and the problem is that the associated visuals render very slow. any help will be highly appreciated.

//

Measure:

 

VAR _TopSerials =

CALCULATETABLE (

TOPN (

10,

CALCULATETABLE (

ADDCOLUMNS (

VALUES ( 'dim_serial_number'[serial_number] ), "@Resets", [# Restarts] ),

 

FILTER ( 'fact_restarts', 'fact_restarts'[RecordDay] >= MAX ( 'fact_restarts'[RecordDay] )

- 6 && 'fact_restarts'[RecordDay] <= MAX ( 'fact_restarts'[RecordDay] ) ) ),

[@Resets] ),

ALL ( 'dim_signature_tag1'[Tag 1] ) )

 

VAR _Serials = SUMMARIZE ( _TopSerials, [serial_number] )

 

RETURN CALCULATE ( [# Restarts],

EXCEPT ( VALUES ( 'dim_serial_number'[serial_number] ), _Serials ) )

 

//

 

@Greg_Deckler  

@tamerj1 

@johnt75 

@Jihwan_Kim 

@FreemanZ 

@amitchandak 

8 REPLIES 8
Anonymous
Not applicable

Sadly, still not @tamerj1  (:..... any other way may be??

Anonymous
Not applicable

HI @Anonymous,

What type of error message the visual shows? Can you please share some more detail information about this issue? They should help us clarify your scenario and test to troubleshoot.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

visual rendering.PNG

tamerj1
Community Champion
Community Champion

@Anonymous 

Please try

=
VAR _TopSerials =
TOPN (
10,
SUMMARIZE (
FILTER (
CALCULATETABLE ( 'fact_restarts', ALL ( 'dim_signature_tag1'[Tag 1] ) ),
'fact_restarts'[RecordDay]
>= MAX ( 'fact_restarts'[RecordDay] ) - 6
&& 'fact_restarts'[RecordDay] <= MAX ( 'fact_restarts'[RecordDay] )
),
'dim_serial_number'[serial_number]
),
[# Restarts]
)
RETURN
CALCULATE (
[# Restarts],
EXCEPT ( VALUES ( 'dim_serial_number'[serial_number] ), _TopSerials )
)

Anonymous
Not applicable

Many thanks but Unfortunately not!  (: as it is even more slower than old one. The old one took 62290 ms and this one did not stop rendering so that i could record performance....(:

@Anonymous 

Ok, please try

=
VAR _TopSerials =
    TOPN (
        10,
        CALCULATETABLE (
            VALUES ( 'dim_serial_number'[serial_number] ),
            ALL ( 'dim_signature_tag1'[Tag 1] ),
            'fact_restarts'[RecordDay]
                >= MAX ( 'fact_restarts'[RecordDay] ) - 6
                && 'fact_restarts'[RecordDay] <= MAX ( 'fact_restarts'[RecordDay] )
        ),
        [# Restarts]
    )
RETURN
    CALCULATE (
        [# Restarts],
        EXCEPT ( VALUES ( 'dim_serial_number'[serial_number] ), _TopSerials )
    )
Anonymous
Not applicable

So when I tried this measure, the visual says" there is not enough memory to complete this operation". So thi is also taking more time than the current one

@Anonymous 

Fine, Please try

=
VAR _RecordDay =
    MAX ( 'fact_restarts'[RecordDay] )
VAR _TopSerials =
    TOPN (
        10,
        CALCULATETABLE (
            VALUES ( 'dim_serial_number'[serial_number] ),
            ALL ( 'dim_signature_tag1'[Tag 1] ),
            FILTER (
                VALUES ( 'fact_restarts'[RecordDay] ),
                'fact_restarts'[RecordDay] >= _RecordDay - 6
                    && 'fact_restarts'[RecordDay] <= _RecordDay
            )
        ),
        [# Restarts]
    )
RETURN
    CALCULATE (
        [# Restarts],
        EXCEPT ( VALUES ( 'dim_serial_number'[serial_number] ), _TopSerials )
    )

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.