Forum Discussion

Datavizuserpbi's avatar
3 years ago
Solved

If date between two dates get the value by year

HI,   I create a measure to check if the date is between 2 dates.  IF(SELECTEDVALUE(DateTable[Date])>=date_min && SELECTEDVALUE(DateTable[Date])<=date_max,1,0) When i have the top 3 month of th ...
  • v-zhangti's avatar
    3 years ago

    Hi, Datavizuserpbi 

     

    You can try the following methods.
    Measure:

    Result = 
     Var _count1=COUNTX(FILTER(ALL('Table'),[Year]=SELECTEDVALUE('Table'[Year])&&[Measure]=1&&[Month]<=3),[Measure])
     Return
    IF(_count1=3,0,1)

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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