Forum Discussion
RanHo
4 years agoHelper V
How To Set Target(Monthly) through Dax
Good day Guys, i just want to ask how can I set target using dax, like that yellow bar on my sample photo. That was my Target for the year 2021, what if I'm going to add different value target for ye...
- Anonymous4 years ago
Hi RanHo ,
According to your description, you want to dynamically set the Target based on the different year.
If so, please try:
target = SWITCH(MAX('Table'[Date].[Year]),2019, 51108, 2020,3528,2021,2465,2022,5673)If you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ALLUREAN
4 years agoSolution Sage
Hi, RanHo
Create a table that contain target per year & month and then connect it to your calendar table.
| Date | Target |
| 01-Jan-21 | 2465 |
| 01-Feb-21 | 2465 |
| 01-Mar-21 | 2465 |
| 01-Apr-21 | 2465 |
| 01-May-21 | 2465 |
| 01-Jun-21 | 2465 |
| 01-Jul-21 | 2465 |
| 01-Aug-21 | 2465 |
| 01-Sep-21 | 2465 |
| 01-Oct-21 | 2465 |
| 01-Nov-21 | 2465 |
| 01-Dec-21 | 2465 |
| 01-Jan-22 | 3000 |
| 01-Feb-22 | 3000 |
| 01-Mar-22 | 3000 |
| 01-Apr-22 | 3000 |
| 01-May-22 | 3000 |
| 01-Jun-22 | 3000 |
| 01-Jul-22 | 3000 |
| 01-Aug-22 | 3000 |
| 01-Sep-22 | 3000 |
| 01-Oct-22 | 3000 |
| 01-Nov-22 | 3000 |
| 01-Dec-22 | 3000 |