Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RanHo
Helper V
Helper 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 year 2022?
(target = 2465) - this was my static Dax , but I need to add more Target for different years so that whenever I filter different year it will change depends on filter, how can I do that?

TARGET....PNG

Thanks in Advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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) 

Eyelyn9_0-1642148865734.png

 

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.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

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) 

Eyelyn9_0-1642148865734.png

 

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
Solution Sage
Solution Sage

Hi, @RanHo 

Create a table that contain target per year & month and then connect it to your calendar table.

DateTarget
01-Jan-212465
01-Feb-212465
01-Mar-212465
01-Apr-212465
01-May-212465
01-Jun-212465
01-Jul-212465
01-Aug-212465
01-Sep-212465
01-Oct-212465
01-Nov-212465
01-Dec-212465
01-Jan-223000
01-Feb-223000
01-Mar-223000
01-Apr-223000
01-May-223000
01-Jun-223000
01-Jul-223000
01-Aug-223000
01-Sep-223000
01-Oct-223000
01-Nov-223000
01-Dec-22

3000




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




amitchandak
Super User
Super User

@RanHo , On of the way is create a target table using enter data , You can give target based on year end date. and join with your date table and use it

 

refer my blog

 

How to Enter Data and Edit it: https://youtu.be/5nE7YGT72kU

 

You do  not want to allocate, but option is there, refer my blog

Distributing/Allocating the Yearly Target(Convert to Daily Target): Measure ( Daily/YTD): Magic of CLOSINGBALANCEYEAR With TOTALYTD/DATESYTD: https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Yearly-Target-C...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Sir, is there a way using Dax? like switch or anything like that if possible?

@RanHo ,

A static measure  , that you can change as per need

 

Target = 2000

 

A DAX Table

Target  = row("Date", Date(year(today()) , 12,31), "Target", 2000)

 

or

 

Target = row("Date", Date(year(today()) , 12,31), "Year",year(today),  "Target", 2000)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.