Forum Discussion
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.
| ID | YEARMM | VOL | TGT | Cosistent_TGT_Achieved |
| 2333 | 202301 | 23 | 20 | N |
| 2333 | 202302 | 16 | 20 | Y |
| 2333 | 202303 | 25 | 20 | N |
| 2333 | 202304 | 22 | 20 | N |
| 2337 | 202301 | 23 | 30 | Y |
| 2337 | 202302 | 26 | 30 | Y |
| 2337 | 202303 | 35 | 30 | Y |
| 2337 | 202304 | 33 | 30 | N |
In this scenario, I'm expecting the count as 1.
Thanks in advance.
7 Replies
- AhmedxSuper User
- AnonymousNot 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.
- AhmedxSuper User
change the date column to the corresponding date column from the calendar it should work
or share the file
- rubayatyasminCommunity Champion
Hi, Anonymous
you need to create some calculated column to achieve the goal. please find the attached solutions file.
- AnonymousNot 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 .