Forum Discussion

Craig08uk's avatar
Craig08uk
New Member
2 years ago
Solved

Error Message when selected multiple months

Hi, 

I get the following error message when my visual is working fine for individual months - but then when certain months are selected together (say last 12 months) the table goes grey

 

Couldn't load the data for this visual

MdxScript(Model) (13, 53) Calculation error in measure 'Cube_Data_Cleansed'[Turnover KPI (000s)]: Function 'SAMEPERIODLASTYEAR' expects a contiguous selection when the date column is not unique, has gaps or it contains time portion.

 

Does anyone have any ideas?

Thanks

Craig. 

3 Replies

  • Craig08uk put the DAX expression that is giving an error and it will probably help.

     

    As a best practice, add a date dimension in your model and use it for time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools. Check the related videos on my YT channel

     

    Add Date Dimension
    Importance of Date Dimension
    Mark date dimension as a date table - why and how?
    Time Intelligence Playlist

     

     

  • Craig08uk are you using column from date dimension in the sameperiodlastyear function? 

    • Craig08uk's avatar
      Craig08uk
      New Member

      THanks for the quick response, sorry I'm just picking up PowerBi and i'm a beginner. The model has been built for us - but I'm trying to fix the error rather than go back to developer. 

      How do I find the sameperiodlastyear function to see if the date dimension column is being used?