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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
michael_knight
Post Prodigy
Post Prodigy

Target Measure doesn't use current month, uses appended query

Hi,

 

I'm trying to create a target measure. I've got two targets which are the same.

 

The black line target in a formula target based on a numbers within the system, the red target is manually given to me at the start of each month and used for the duration of the month until there is enough data in the system. 

 

Targets.PNG

 

I want to create a measure that uses the black line for every single month apart from the current month, and use the red line for only the current month

 

Any help would be appriciated

 

If you have any question please don't hesitate to ask

 

Thanks,

Mike

6 REPLIES 6
v-eachen-msft
Community Support
Community Support

Hi @michael_knight ,

 

Do you mean to create a single line with these two lines?

You could use IF() and SELECTEDVALUE() functions to judge if it is current month. If it returns TRUE, you could use the measure of red line. If it returns FALSE, you could use the measure of blank line.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-eachen-msft ,

 

Yes I do want them in the same line

 

Sorry, I'm still learning DAX. I tried with the code below but I have had no luck. 

IsCurrentMonth = 
IF( 
    SELECTEDVALUE(Appointment[createdon].[Date]) =MONTH(NOW(),[Target], 'Targets- WBAH'[WBAH Target]))

 

The theory I want is

 

If current month, return 'Target', else return 'WBAH Target' 

 

Any suggestions

 

Thanks,

Mike

Hi @michael_knight ,

 

You could try the following DAX:

IsCurrentMonth =
IF (
    SELECTEDVALUE ( MONTH ( Appointment[createdon] ) ) = MONTH ( NOW () ),
    [Target],
    SELECTEDVALUE ( 'Targets- WBAH'[WBAH Target] )
)

All values you return need to be measure.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-eachen-msft 

 

Give it another go and still no luck. I tweeked your code a bit to make it work and the measure itself is working now, but it isn't showing what I need. It's returning 'Targets' throughout rather than only showing 'Targets' for the current month 

IsCurrentMonth = 
IF (
    SELECTEDVALUE ( 'Full Date'[Full Date]) = MONTH ( NOW () ),
    [Target],
    SELECTEDVALUE('Targets- WBAH'[Target], 'Targets- WBAH'[WBAH Target]) ) 

 

Targets.PNG

 

Thanks,

Mike

Hi @michael_knight ,

 

You need to add month() function as MONTH(SELECTEDVALUE('Full Date'[Full Date])). According to your situation, the month is the key to comparison. If you want to compare more carefully, you could refer to the following DAX:

 

IsCurrentMonth = 
IF (
    MONTH ( SELECTEDVALUE ('Full Date'[Full Date])) = MONTH ( NOW () )
 && YEAR ( SELECTEDVALUE ('Full Date'[Full Date])) = YEAR ( NOW () ),
    [Target],
    SELECTEDVALUE('Targets- WBAH'[Target], 'Targets- WBAH'[WBAH Target]) ) 

 

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-eachen-msft ,

 

Thanks for the help. I've still had no luck. It shows the values that I want to show just the current month for every month 

 

I am going to include the PBIX file if you want to see what I'm playing around with, it might make it easier.

 

https://www.dropbox.com/s/02mxxdtyu5hon77/Acquisitions%20-%20Community%202.pbix?dl=0

 

Thanks,

Mike

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors