Forum Discussion

adnankabina's avatar
adnankabina
Helper II
5 years ago
Solved

Refresh time on visual

I want to show Estern time on my visual. I have schedule for every 2 hours to refresh my data.  what I did on measure

Last Refreshed Time = UTCNOW()-TIME(4,0,0)

It is showing fine but it should stay same time until next refresh is done.  Below pic shows it refreshed at 6pm eastern time. If user goes to on 6:45pm and try to refreh from menue as show in pic should not change it.

 
 

 

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi adnankabina ,

     

    In your scenario, you should use Calculated Column or M Query instead of Measure.

    The former will refresh time after the dataset was refreshed, the latter will refresh time after the page was refreshed.

    For calculated column, right click on the table and create a new column using your formula.

    For M Query, open query editor and add custom column with below formula.

    DateTime.LocalNow() + #duration(0,4,0,0)

     

    Best Regards,

    Jay

7 Replies

    • adnankabina's avatar
      adnankabina
      Helper II

      Thanks for help. After publishing it is showing me UTC time , how can i subtract 4 hours? any idea

      • AnkitKukreja's avatar
        AnkitKukreja
        Super User

        Hi adnankabina 

         

        Yes, please use DateTime.From ( [DateTime] ) + #duration(0, +5,0,0)

        Note : +5 is utc to my time zone (so change as per your need). And [DateTime] is my date time column already availbale.

         

         

        Thanks,

        Ankit

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi adnankabina ,

     

    In your scenario, you should use Calculated Column or M Query instead of Measure.

    The former will refresh time after the dataset was refreshed, the latter will refresh time after the page was refreshed.

    For calculated column, right click on the table and create a new column using your formula.

    For M Query, open query editor and add custom column with below formula.

    DateTime.LocalNow() + #duration(0,4,0,0)

     

    Best Regards,

    Jay

  • Anonymous's avatar
    Anonymous
    Not applicable

    I appreciate this entire thread of discussion, but it seems to be taking the System date (LocalNow) and adding it to the report.  My question is this:  I want the report to show the last date/time the report was refreshed, and “date/time” refers to the Refresh time set in the Gateway settings for refresh.  I know when that is supposed to be, because the report generating person, I set that date and time.  However, the consumer of the report does not necessarily know that and then it would be convenient to have a measure (or calculated column or…) that automatically shows when the actual last refresh date/time was so that the consumer is reassured that they are looking at “current” data.  I was looking at wrong a measure, but how do I access that date/time, set up in the Gateway settings, and integrate that with the report.??