Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Apply a filter to remove a specific date for DST

Hi,

I have a table that shows days divided into 30 min segments, with a production total for each period and when there is a Daylight Saving day, there will be 50 or 46 segments, not 48. I need to be able to display the best production day, but exclude days that have 50 segments. Example table below - not showing all periods 🙂 I need to be able to show the total for days including DST so can't just filter out the days where DST occurs.

 

I have referenced the source table and grouped by the date column to find the day with the highest value, but I am stuck in trying to find a way to filter out an entire day so that I can take the best day, ignoring DST changes. Any advice would be appreciated!

DATE YYYYMMDD      PERIOD     OUTPUT
2021052046321.1
2021052047320.0
2021052048319.6
.........
2021052146322.1
2021052147321.5
2021052148320.2
2021052149 318.4
2021052150320.5
.........
2021052246312.2
2021052247319.0
2021052248319.9

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    According to the table you provided, I first created a date column.

    Date = Date(Left([DATE YYYYMMDD],4),Right(left([DATE YYYYMMDD],6),2),right([DATE YYYYMMDD],2))

     

    Then create two measures. The first meaesure is to calculates the sum of the output grouped by date.

    Sum = CALCULATE(SUM('Table'[OUTPUT]),FILTER(ALLSELECTED('Table'),[DATE YYYYMMDD]=MAX('Table'[DATE YYYYMMDD])))
    the best production day = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[Sum]= MAXX(ALL('Table'),[Sum])))

     

     

    Best Regards,

    Stephen Tao

     

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

     

3 Replies

  • Hey Anonymous 

     

    Can you please provide the input data as a table please. I belive the table that you have shown is result table.

     

    Thanks

    Thingsclump

    www.thingsclump.com

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Thingsclump . I can't provide the actual table, commercial stuff and all, but the data looks like as shown. with  one extra columns. A date column (not formated as a date data type), a period column showing 1- 48 for most days, except daylight saving days, and a output column showing the production output as received from SCADA for each period.

      I think I might have worked out a way aournd it, by duplicating the table, grouping by date, aggregating SUM of output data, and MAX period number. I'm then filtering out the days where MAX period = 50.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    According to the table you provided, I first created a date column.

    Date = Date(Left([DATE YYYYMMDD],4),Right(left([DATE YYYYMMDD],6),2),right([DATE YYYYMMDD],2))

     

    Then create two measures. The first meaesure is to calculates the sum of the output grouped by date.

    Sum = CALCULATE(SUM('Table'[OUTPUT]),FILTER(ALLSELECTED('Table'),[DATE YYYYMMDD]=MAX('Table'[DATE YYYYMMDD])))
    the best production day = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[Sum]= MAXX(ALL('Table'),[Sum])))

     

     

    Best Regards,

    Stephen Tao

     

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