Forum Discussion
robertomari2020
Helper I
6 years agoShow only the value for the current Year
Hi everyone, I think I have a pretty simple question. How do I have to change this measure in order to ONLY show values for the current year? (I want to show the accumulated values of the c...
v-kelly-msft
Community Support
6 years agoHi robertomari2020 ,
Create a measure similarly as below:
Measure =
Var _year=YEAR(TODAY())
Return
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])&&YEAR('Table'[Date])=_year))
And you will see:
In you case,you may try below dax expression:
ShowOnlyValueForCurrentYear =
VAR maxWeek = CALCULATE(MAX('Calendar'[CalendarWeek]),ALL('Calendar'))
VAR maxYear = CALCULATE(MAX('Calendar'[Year]),ALL('Calendar'))
RETURN
CALCULATE(
[Total Value Orders];
ALL('Calendar'[CalendarWeek]);
FILTER(ALL('Calendar'[Year]); 'Calendar'[Year] = maxYear);
'Calendar'[CalendarWeek] <= maxWeek
)
I made a sample .pbix file if needed.
Best Regards,
Kelly
Kelly
Did I answer your question? Mark my post as a solution!
FrankAT
Community Champion
6 years agoHi v-kelly-msft ,
you have attached a PBIX file to your reply, which you addressed to community.powerbi.com at the address...
Question: How can I upload a PBIX file to any of my posts in the community?
Regards FrankAT
- v-kelly-msft6 years ago
Community Support
Hi FrankAT ,
Just upload your .pbix file to Onedrive business and make a public link to share.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!