Forum Discussion
Datediff using months
- 5 years ago
Hi, Pmorg73
Sorry for not being able to reply you in time due to busy Monday.
If you use a calendar table date column in your visual, you can easily modify your measure.
Like this:
Measure = MAXX ( FILTER ( 'Table', [job summary] = SELECTEDVALUE ( 'Table'[job summary] ) ), RELATED ( 'Table 2'[Date] ) )If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Pmorg73
According to your description, I think you can modify your measure to calculate the desired result.
Like this:
last date =
MAXX (
FILTER ( 'Table', [job summary] = SELECTEDVALUE ( 'Table'[job summary] ) ),
[date]
)No of months old = -DATEDIFF(TODAY(), [last date], MONTH)Here is my sample .pbix file.Hope it helps.
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the help and the logic. It does not seem to be working for me. I have a seperate date table, but using the measure I can not select the date column in that, only in my fact table.
data:
measure used:
result:
model:
any thoughts?
- v-janeyg-msft5 years agoCommunity Support
Hi, Pmorg73
Sorry for not being able to reply you in time due to busy Monday.
If you use a calendar table date column in your visual, you can easily modify your measure.
Like this:
Measure = MAXX ( FILTER ( 'Table', [job summary] = SELECTEDVALUE ( 'Table'[job summary] ) ), RELATED ( 'Table 2'[Date] ) )If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Pmorg735 years agoPost Patron
Its curious. I can not get it to work
measure
result
I am still getting a result for each entry
- v-janeyg-msft5 years agoCommunity Support
Hi, Pmorg73
Since you didn‘t provide sample data and files, the sample I made is to reproduce the content of your screenshots, and there may be some situations that are not mentioned and cause problems.
Is the 'total all wip' a measure? Can you provide the formula? Since you didn’t specify, I used it as a column directly in my sample.
You need to provide more information so I can help you.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.