Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

undefined

Hello there,   I am stuck trying to incorporate one of the requirements asked by my boss. We have a Max_Time criteria table; which is essentially - If the order is sold at the exact time of the hou...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hey guys,

     

    I solved it. Thank you for your time! 

    If anyone is curious - I was using calculated columns before so I was getting circular dependencies. 

     

    I used the measures -

    Max Hour Logic = IF(Max hour <= Max time, "Y", "N")

     

    2019 = IF((MAXX('Table','Table'[Ord_Date])=TODAY()),CALCULATE(SUMX('Table','Table'[demand]),'Table'[Max Hour logic]="Y"),CALCULATE(SUMX('Table','Table'[demand])))
     
    2018 = IF((maxx('Table','Table'[Ord_Date])<TODAY()),calculate(sumx('Table','Table'[LY $])),CALCULATE(sumx('Table','Table'[LY $]),'Table'[Max Hour Logic]="Y"))
     
    BGT = IF((maxX(''Table','Table'[Ord_Date])<Today()),CALCULATE(Sumx('Table',[Budget])),CALCULATE(Sumx('Table',[Budget]),'Table'[Max Hour Logic]="Y"))