Forum Discussion

godtooro's avatar
godtooro
Helper II
2 years ago
Solved

Calculate if

Dear all!

 

Please I need you support.

I want to calculate if [Due Date] < [Date of DataSet].

 

I've tried:

Overdue Amount =
    var _DuelesDate = FILTER(BIFAR000, BIFAR000[Due Date] < BIFAR000[Date of Dataset])

    return

        SWITCH(
            TRUE,
            _DuelesDate, [Amount])
 
But is not working.
 
I've tried:
CALCULATE(
        [Amount],
        BIFAR000[Due Date] < BIFAR000[Date of Dataset])
 
But neither.
 
Do you have an idea?

 

  • godtooro's avatar
    godtooro
    2 years ago

    Thank u Anonymous !
    Working!!!!!!

    Thank you so much!

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello godtooro Try this measure.
    Overdue Amount = SUMX( FILTER(BIFAR000, BIFAR000[Due Date] < BIFAR000[Date of Dataset]), BIFAR000[Amount] )

    • godtooro's avatar
      godtooro
      Helper II

      Thank u Anonymous !
      Working!!!!!!

      Thank you so much!

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hello godtooro Please accept as a solution!.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Ensure that both the "Due Date" and "Date of Dataset" columns are properly recognized as date types in your data model.

    If they are not, you can change their data types by right-clicking on the column header and selecting "Change Type" > "Date."

    • godtooro's avatar
      godtooro
      Helper II

      Hi Anonymous you were right.
      I've changed data type to date and solved.