Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Dynamic Date Headers

I created a table with dates that updates every week.

 

 

 

I created a straight table where I list all the fields with icons (KPI). You will see the dates are ordered as the OrderID above.

 

 

 

 

Under the advanced editor I updated the code as below.

 

 

As soon as I refresh the report and new dates are inserted, my graphs breaks because the dates doesn’t exist on the straight table.  Example, next week 20200926 will be updated to 20201003 and all the graphs will break and I need to remove the old date and add the new date. I also need to update all the KPI fields because the dates are in the measure.

 

Is there any other way I can do this?

 

8 Replies

  • Hi Anonymous ,

     

    Are the table you make then unpivot to give column values? To what I can see  you have each date as a column on your model correct?

    • Anonymous's avatar
      Anonymous
      Not applicable

      That is correct and the KPI's (red and green icons) calculates the difference for date 1 and 2 and the same for column 5 and 6. Its a table and not a matrix visual.

      • MFelix's avatar
        MFelix
        Super User

        The issue comes when you make the unpivot of the columns, based on the date, since the date are always updating you are getting new column headers and that is not matching your data.

         

        Believe that the best way is using the original data and then use DAX to make the calculations for the table.

         

        Can you share a sample of the data?