Forum Discussion
miguelp06
2 years agoFrequent Visitor
Return value acording a date
Hi all
I have this table:
Today (01/11/2024) i want return 2022/2023.
After 10/01/2024 i want return 2023/2024.
Anyone can help me?
Thanks you all
- Anonymous2 years ago
Hi miguelp06 ,
You can try to use the CALCULATE and VALUES functions for the same purpose. Refer to below dax:
AnoAtual = CALCULATE ( VALUES ( dAnoLetivo[Ano Letivo] ), dAnoLetivo[Ano] = YEAR ( TODAY () ) - 2 )
Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly
2 Replies
- miguelp06Frequent Visitor
I found a solution.
First create a YEAR column based on the Data column.
Then I used the following function:
AnoAtual = LOOKUPVALUE(dAnoLetivo[Ano Letivo],dAnoLetivo[Ano],YEAR(TODAY())-2) - AnonymousNot applicable
Hi miguelp06 ,
You can try to use the CALCULATE and VALUES functions for the same purpose. Refer to below dax:
AnoAtual = CALCULATE ( VALUES ( dAnoLetivo[Ano Letivo] ), dAnoLetivo[Ano] = YEAR ( TODAY () ) - 2 )
Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly