Forum Discussion

elcamino's avatar
elcamino
Frequent Visitor
1 year ago
Solved

Increase the loading speed of a table visualization

Hi everyone, I have this semantic model   I have a table visualization with more than 90 columns. Around 80 of these, are measures that are updated dinamically based on a date filter from th...
  • Greg_Deckler's avatar
    1 year ago

    elcamino You could try this alternative:

    X = 
      VAR __CurrentDate = MAX( 'Dim_calendar'[Date] )
      VAR __Table = FILTER( 'Table1', [Start_Date] <= CurrentDate ) && [End_Date] >= CurrentDate )
      VAR __Result = MINX( __Table, [X] )
    RETURN
      __Result

    That said, 90 columns with 80 of those being measures is a lot of computation.

  • MFelix's avatar
    1 year ago

    Hi elcamino ,

     

    Such a huge table for sure will create a very large loading time.

     

    If most of your measures are based on the same calculation have you tried using a Calculation group that changes the way the calculation is done?

     

    So you would basically do the measures with the MIN syntax and then on the calculation group you would do the variation.

     

    This would be similar to this:

     

    x_ =  MIN(Table[X])
    
    
    Calculation group = 
      VAR CurrentDate = MAX( 'Dim_calendar'[Date] )
      VAR Result = CALCULATE(SELECTEDMEASURE(), Table[Start_Date] <= CurrentDate
                && Table[End_date] >= CurrentDate )
    RETURN
      Result

     

    Not sure how the other measures are calculated but you can do something similar for the other measures that are different calculated:

    Calculation group = 
      VAR CurrentDate = MAX( 'Dim_calendar'[Date] )
      VAR Result = CALCULATE(SELECTEDMEASURE(), Table[Start_Date] <= CurrentDate
                && Table[End_date] >= CurrentDate )
    RETURN
    
     IF(
        SELECTEDMEASURENAME() IN {"A", "B", "C"},
        SELECTEDMEASURE(),
         Result)

    for this syntax measures A, B and C will be calculated normally and the other will be based on the filter.

     

    But I would advise you to do a different table, or if the users really need this type of visualization I would give them the chance to use the Excel connection to the semantic model and not online experience.

  • mark_endicott's avatar
    1 year ago

    elcamino - To add to the execllent DAX based solutions here. 

     

    The best way to make this table load quicker would be to put the 80 measures into a field parameter, and ask your users to pick the most useful 5. These are the ones that load in the table as default, the others can be added to the table / matrix as and when users need them.

     

    There's absolutely no way people are looking at all 80 measures every time they use this table. 

     

    Here's some more information on them: https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters 

     

    If I answered your question please mark my post as the solution, it helps others with the same challenge find the answer!