Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Outdated product - DAX Measure

Hello, 

Basic information: 

In "Green" calculation we had the change and it means: All Product > TODAY

 

I have an issue with measure because the measure is counting values incorrectly. I would like the measure to also take into account the individual days of the month but for rest days of December it doesn't display values: 

How to change the calculation in this measure? 

 

This is pbix file with my calculations: 

https://uewrc-my.sharepoint.com/:u:/g/personal/170361_student_ue_wroc_pl/EZopWei7GwFHjmyczp3DqQMBtppFDKN5xZogqATL-I3xvA?e=H6L2H9

 

Could you help me, please? 

 

  • I think your calculation does not consider "diff = 0" scenario. See if the below works:

     

    Measure 2 = 
    var cur_yearly_review=SELECTEDVALUE('Table'[Yearly review])
    var cur_date=TODAY()
    var diff=DATEDIFF(cur_yearly_review,cur_date,MONTH)
    -- return diff
    return 
    SWITCH(TRUE(),
           diff > 6, "More than 6 months",
           diff >= 0, "Less than 6 months",
           diff < 0, "All recertified")

     

     

1 Reply

  • I think your calculation does not consider "diff = 0" scenario. See if the below works:

     

    Measure 2 = 
    var cur_yearly_review=SELECTEDVALUE('Table'[Yearly review])
    var cur_date=TODAY()
    var diff=DATEDIFF(cur_yearly_review,cur_date,MONTH)
    -- return diff
    return 
    SWITCH(TRUE(),
           diff > 6, "More than 6 months",
           diff >= 0, "Less than 6 months",
           diff < 0, "All recertified")