Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Published report looks different!

Hi,

 

I have a report which I created in Power BI desktop, but when I publish it, it looks different! seems like it can't get the data...

I have attached screenshots from the desktop version and the published one.

 

any idea why is it

happening?

Thanks,

 

I have one variable that uses some vars, could this be causing issue? the rest of them are straight forward:

"Project =
var PlanDateYr = Year(ResPlan[Date])
var PlanDateMnth = MONTH(ResPlan[Date])
var TodayYr = YEAR(TODAY())
var TodayMnth = MONTH(TODAY())
Return
if(ResPlan[Work Type]="Project",
if(PlanDateYr < TodayYr, if(ResPlan[CostType]="Actual",ResPlan[Hours],0),
if(PlanDateYr=TodayYr, if(PlanDateMnth<TodayMnth, if(ResPlan[CostType]="Actual",ResPlan[Hours],0),if(ResPlan[CostType]="Forecasted",ResPlan[Hours],0)),
if(ResPlan[CostType]="Forecasted",ResPlan[Hours],0))),0)"

 

  • Hi  Anonymous ,

    Seeing that Today() is used in your function, it may be because the time and date of Power BI Desktop and Power BI Service are different.

     

    Power BI Desktop uses the date and time of your computer's local time zone, while Power BI Service only supports date and time in UTC format.

     

    If you punish your report with local timezone datetime values, it will convert your datetime values to UTC format and they may different than your desktop values.

     

    You might consider using the dax function to add or subtract the difference between your timezone and UTC time.

    For example:

    Time = Now()-(8/24)

    For more details, you can check the following link:

    Solving DAX Time Zone Issue in Power BI

    Daylight Saving Time And Time Zones In M

    Page not found – Bond Consulting Services

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Thanks for your reply Liu,

    I ended up adding a refresh button which seemes to resolve the issue. what you suggested makes sense.

    I think the Today() function messed up my report.

    Thanks again

     

6 Replies

  • Duia's avatar
    Duia
    Resolver II

    Hi  Anonymous ,

    Seeing that Today() is used in your function, it may be because the time and date of Power BI Desktop and Power BI Service are different.

     

    Power BI Desktop uses the date and time of your computer's local time zone, while Power BI Service only supports date and time in UTC format.

     

    If you punish your report with local timezone datetime values, it will convert your datetime values to UTC format and they may different than your desktop values.

     

    You might consider using the dax function to add or subtract the difference between your timezone and UTC time.

    For example:

    Time = Now()-(8/24)

    For more details, you can check the following link:

    Solving DAX Time Zone Issue in Power BI

    Daylight Saving Time And Time Zones In M

    Page not found – Bond Consulting Services

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your reply Liu,

      I ended up adding a refresh button which seemes to resolve the issue. what you suggested makes sense.

      I think the Today() function messed up my report.

      Thanks again

       

  • gauthamboppana's avatar
    gauthamboppana
    Solution Specialist

    Anonymous  - Are you using a date hierarchy field in your x-axis? If yes, can you check it to normal field and use it (instead of date hierarchy).  Let me know if this works.

     

     



    Did I answer your question? Mark my post as a solution! If not, please feel free to ask me.

    Also, I would ❤ Kudos if my solution helped.  It is a token of appreciation!

    Thank you very much !

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your reply. I am only using one date and that is not hierarchy:

       

  • gauthamboppana's avatar
    gauthamboppana
    Solution Specialist

    Anonymous  - can you share the .pbix file with sample data? I can have a look at it.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I found out why the published report shows different result but I still dont know why it's doing it and how to fix it.

      The published report only shows data for January 1st of each year but the slicer on the desktop shows the data for each month (based on the selection)

      I also found that this column is the issue, if I remove it the published report matches the desktop, when I add it again, it doesn't any more:

      "Project =

      var PlanDateYr = Year(ResPlan[Date])
      var PlanDateMnth = MONTH(ResPlan[Date])
      var TodayYr = YEAR(TODAY())
      var TodayMnth = MONTH(TODAY())
      Return
      if(ResPlan[Work Type]="Project",
      if(PlanDateYr < TodayYr, if(ResPlan[CostType]="Actual",ResPlan[Hours],0),
      if(PlanDateYr=TodayYr, if(PlanDateMnth<TodayMnth, if(ResPlan[CostType]="Actual",ResPlan[Hours],0),if(ResPlan[CostType]="Forecasted",ResPlan[Hours],0)),
      if(ResPlan[CostType]="Forecasted",ResPlan[Hours],0))),0)"
       
      All I am trying to do here is to compare dates between ResPlan Column and Today's date.
      if ResPlan Year is less than Current Year then I get Actual Hours.
      If the ResPlan year is equal to current Year then I compare months and if ResPlan month is less than current month again I get Actual Hours other wise I get Forcasted Hours.
      Finally if the ResPlan Year is greater than Current Year then I get FOrcasted Hours.