Forum Discussion

arvindyadav's avatar
arvindyadav
Post Partisan
7 years ago
Solved

How may I know Current Hour Data

Hi Team,

 

How may I know that the current hour of revenue of yesterdays or day before yesterdays in power bi.

and the data format is below where hour_id is hour:-

 

  • v-piga-msft's avatar
    v-piga-msft
    7 years ago

    Hi arvindyadav ,

    Please try the measure below.

    today_rev = CALCULATE(MAX('Table'[Revenue]),FILTER('Table','Table'[date]=TODAY()))
    yesterday = CALCULATE(MAX('Table'[Revenue]),DATEADD('Table'[date],-1,DAY))

    Here is the output.

    Best Regards,

    Cherry

6 Replies

  • vminvsky's avatar
    vminvsky
    Frequent Visitor

    Two things. One you can simply create a new measure that's a sum of revenue. Then create a graphic with hour ID on X-axis and add a filter where you can select the day. Alternatively, you can create a new table using the summarize function. In your case it would be 

    By Hour = SUMMARIZE(table_name <- this is ur table name, date column, hour_id column, "Revenue", sum(revenue column))

    • arvindyadav's avatar
      arvindyadav
      Post Partisan

      Hi vminvsky ,

       

      Didn't understand anything from your message.

      can you please explain me clearly?

       

      Thanks,

      Arvind

  • mussaenda's avatar
    mussaenda
    Community Champion

    Please elaborate what you really needed. Provide a sample output to answer you questions faster.

    Thank you.

    • arvindyadav's avatar
      arvindyadav
      Post Partisan

      Hi mussaenda ,

       

      Suppose we have data which have hours, date and revenue column in it. and from that, I want to create a dynamic table like if the todays current hour is 6 and I want to know what is revenue in this current on yesterdays.

      Please find the image.

      Note- don't want to use any filter.

      Thanks,

      Arvind

      • v-piga-msft's avatar
        v-piga-msft
        Resident Rockstar

        Hi arvindyadav ,

        Please try the measure below.

        today_rev = CALCULATE(MAX('Table'[Revenue]),FILTER('Table','Table'[date]=TODAY()))
        yesterday = CALCULATE(MAX('Table'[Revenue]),DATEADD('Table'[date],-1,DAY))

        Here is the output.

        Best Regards,

        Cherry