Forum Discussion

elcamino's avatar
elcamino
Frequent Visitor
1 year ago
Solved

Improve Perfomance

Hi, I have a semantic model similar to this one 

I have created a table visualization with 90 measures and one column called key that's the one from the DataBridge table.

Almost all my measures have this format:

X=
VAR CurrentKey = MAX('DataBridge'[Key])
VAR CurrentDate = MAX('Dim_calendar'[Date])
RETURN
CALCULATE(
    FIRSTNONBLANK('Table1'[X], 1),
        'Table1'[Code] = CurrentKey  &&
        'Table1'[Start_Date] <= CurrentDate  &&
      'Table1'[End_date] >= CurrentDate
    )


However, my table visualization is too slow.


 

Which are the best options to improve the speed of my table visualization?

Thank you.

  • You can try

    X =
    VAR CurrentDate =
        MAX ( 'Dim_calendar'[Date] )
    RETURN
        CALCULATE (
            MIN ( 'Table1'[X] ),
            'Table1'[Start_Date] <= CurrentDate
                && 'Table1'[End_date] >= CurrentDate
        )
    

    You don't need to explicitly filter for the key, as that filter will pass along the relationship from the bridge table to the others, and MIN might perform quicker than FIRSTNONBLANK.

  • Thank you, johnt75for your response.

     

    Hi elcamino,

     

    We would like to check if the solution provided by johnt75 has resolved your issue. If you have found an alternative approach, we encourage you to share it with the community to assist others facing similar challenges.

    If you found the response helpful, please mark it as the accepted solution and add kudos. This recognition benefits other members seeking solutions to similar queries.

     

    Thank you.

2 Replies

  • You can try

    X =
    VAR CurrentDate =
        MAX ( 'Dim_calendar'[Date] )
    RETURN
        CALCULATE (
            MIN ( 'Table1'[X] ),
            'Table1'[Start_Date] <= CurrentDate
                && 'Table1'[End_date] >= CurrentDate
        )
    

    You don't need to explicitly filter for the key, as that filter will pass along the relationship from the bridge table to the others, and MIN might perform quicker than FIRSTNONBLANK.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Thank you, johnt75for your response.

     

    Hi elcamino,

     

    We would like to check if the solution provided by johnt75 has resolved your issue. If you have found an alternative approach, we encourage you to share it with the community to assist others facing similar challenges.

    If you found the response helpful, please mark it as the accepted solution and add kudos. This recognition benefits other members seeking solutions to similar queries.

     

    Thank you.