Forum Discussion
Target Measure doesn't use current month, uses appended query
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.
- michael_knight6 years ago
Post Prodigy
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]) )Thanks,
Mike
- v-eachen-msft6 years ago
Community Support
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]) )- michael_knight6 years ago
Post Prodigy
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