Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello
Can you please assist. I have a bar chart that displays a measure by yearmonth and I have 2 years worth of data on the report. If I haven't selected the year it shows all the 2 years, like below.
I need to default the dashboard to show only the latest year and month on the data, without the user selecting the year on a slicer:
I've tried doing it just for the year on the measure but it's still not displaying correctly (still displays 24 months), how do I go about this? Below is the current measure:
Thank you @Anonymous , but I'm still not getting the results I want. The expression works only when I select a year, see below: and I modified the DAX a bit to suit my needs:
Measure =
var MaxYear = max('Calendar'[Fiscal Year])
RETURN
IF(SELECTEDVALUE('Calendar'[Fiscal Year]) = MaxYear, sum('Branch Scores'[Nr Errors]),
CALCULATE(sum('Branch Scores'[Nr Errors]),
FILTER('Calendar','Calendar'[Fiscal Year] = max('Calendar'[Fiscal Year])
)
))
Then when I deselect the year, I still get 2020 figures on the matrix even though I've specified on the DAX to give me results just for the max year which in this case is 2021. What am I doing wrong?
Hi @Tlotly
I create a sample ,maybe you can refer to it .
Original data:
Then create a measure to return the latest data .
the latest year = CALCULATE(SELECTEDVALUE('Table'[Value]),FILTER('Table',YEAR(SELECTEDVALUE('Table'[Date]))=YEAR(TODAY())))
The effective is as shown (add the measure and date into a bar chart):
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |