Forum Discussion

PeterUghut's avatar
PeterUghut
Copper Contributor
Jul 11, 2021

Overdue Calculations Dax

I have a fact table that is sort of a historian, I want to write a Dax measure that will give me Overdue Days.

If the Completed Column is 12/31/1899, it means the test is yet to be performed. So my first calculation is to filter Completed Date Column by 12/31/1899; 

Secondly, I can now find the number of days past due or Overdue from subtracting Planned Date from Today().

Finally I need it to be placed into buckets i.e. 7 days past due, 30 days past due and > 90 days past due.

Please any help will be greatly appreciated...... and the goal is by Dax measures but calculated columns will also suffice

 

Instrument TagStatusService DaysCompleted_DatePlanned_Date
AT-001499147/8/20216/5/2021
AT-011599147/8/20216/26/2021
ANALYZER-TASK-299146/23/20216/26/2021
ANALYZER-TASK-299147/5/20217/7/2021
ANALYZER-TASK-299146/12/20216/7/2021
ANALYZER-TR399146/28/20216/16/2021
ANALYZER-TR399146/2/20216/3/2021
ANALYZER-TR199146/8/20216/10/2021
AT-0201A99146/25/20216/24/2021
AT-0201A99147/6/20217/9/2021
AT-0201A99146/10/20216/7/2021
AT-200599146/22/20216/22/2021
PC-023A5536512/31/18996/1/2021
PC-108C5536512/31/18996/5/2021
ROTATING-TAGS-25536512/31/18996/6/2021
PC-022A5536512/31/18996/6/2021
PC-001B5536512/31/18996/8/2021
XF-0155536512/31/18996/22/2021
TURBINE-STEAM-TR25536512/31/18996/22/2021
TURBINE-STEAM-TR15536512/31/18996/22/2021
PC-109B5536512/31/18997/7/2021
PLANT-GEN5536512/31/18996/26/2021
GAS-SYSTEM-TR25536512/31/18997/15/2021
PC-108C5518012/31/18997/25/2021

4 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    PeterUghut 

    DAX measure assumes you will aggregate the source by PivotTable. From sample source table it's not clear which kind of aggregation it'll be, other words how DAX measure will be used.

    • PeterUghut's avatar
      PeterUghut
      Copper Contributor
      Thanks....this was actually a Power BI question....... I have reposted my question in the Power BI Community space
    • PeterUghut's avatar
      PeterUghut
      Copper Contributor
      Thanks........ yeah I realized that and asked the question in the Power BI community

Resources