Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

DAX - Consecutive 3 months target

Hi Team, 

Please help with the DAX to count users who achieved target for consecutive 3 months. Any quick help is appreciated.
Sample data is given below.

IDYEARMMVOLTGTCosistent_TGT_Achieved
23332023012320N
23332023021620Y
23332023032520N
23332023042220N
23372023012330Y
23372023022630Y
23372023033530Y
23372023043330N

In this scenario, I'm expecting the count as 1.

 

Thanks in advance.

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ahmedx ,

      Thanks for your quick response, I should have clarified this. I have Calendar table for dates, Customer table for ID & VOL & TGT from 2 different fact tables. But all are related. In this case, I'm not able to make the WINDOW function work. Please help with this scenario.

      • Ahmedx's avatar
        Ahmedx
        Super User

        change the date column to the corresponding date column from the calendar it should work

        or share the file

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi rubayatyasmin ,

      Thanks for your quick response, I'm using a dataset that's common to multiple reports where we will create columns only if there is no way to achieve the result in measures. It will be great if you could help with measures for the scenario below.
      I should have clarified this. I have a Calendar table for dates, Customer table for ID , VOL & TGT from 2 different fact tables. But all are related .