Forum Discussion

Chaucer's avatar
Chaucer
Helper II
8 years ago
Solved

Units Sold Since 5pm Yesterday

Hi There,   I'm trying to generate a report that show the units sold since 5pm yesterday.    My Data table has a Date/Time column, and a Date column. I have a fairly standard Date table with vari...
  • Vvelarde's avatar
    Vvelarde
    8 years ago

    Chaucer

     

    Hi, Try this to obtain sales from 5PM of Previous Day

     

    Calculated Column 

     

    1. InvoiceDate-OnlyDate = 'All Invoices'[Invoice Date].[Date]  --Modeling - Format -- To only Date

     

    2. InvoiceDate-Diff =
    DATEDIFF('All Invoices'[InvoiceDate-OnlyDate],TODAY(),DAY) * 100 + hour('All Invoices'[Invoice Date])

     

    In level filter add:

     

     

    Regards

     

    Victor

  • Chaucer's avatar
    Chaucer
    8 years ago

    Hi Victor,

     

    That was great thank you. I made a minor tweak to it as what it was actualy giving me was sales before 5pm yesterday plus sales so far today. 

    Changing 

     

    InvoiceDate-Diff = DATEDIFF('All Invoices'[InvoiceDate-OnlyDate],TODAY(),DAY) * 100 - hour('All Invoices'[Invoice Date])

     

    and then filtering for values under 83 worked!

     

    Many thanks on this.