Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello
I have a report that has a segmentation of data by year, where I visualize my amounts depending on the selected year. I need that when I DO NOT select any year the graphs or measures show me by default the amounts of the maximum (or current) year. There is a way to do it.
Thank you
Solved! Go to Solution.
In Power BI using DAX, you can create a measure that checks if the slicer value is blank and, if so, applies the maximum year as the filter. Here’s how you can do it:
Create a Year Slicer: Ensure you have a slicer in your Power BI report that allows users to select a year.
Create a Measure: Write a DAX measure to apply the maximum year when the slicer is blank.
Here is an example of how you can do this:
SelectedYear =
IF(
ISBLANK(SELECTEDVALUE('Calendar'[Year])),
MAX('Calendar'[Year]),
SELECTEDVALUE('Calendar'[Year])
)
To apply this measure as a filter, you can use it in the Filter pane by setting it in the filter section of your visuals.
Here is an example of how you might use it in a visual calculation:
SalesAmountFiltered =
CALCULATE(
SUM(Sales[SalesAmount]),
'Calendar'[Year] = [SelectedYear]
)
In Power BI using DAX, you can create a measure that checks if the slicer value is blank and, if so, applies the maximum year as the filter. Here’s how you can do it:
Create a Year Slicer: Ensure you have a slicer in your Power BI report that allows users to select a year.
Create a Measure: Write a DAX measure to apply the maximum year when the slicer is blank.
Here is an example of how you can do this:
SelectedYear =
IF(
ISBLANK(SELECTEDVALUE('Calendar'[Year])),
MAX('Calendar'[Year]),
SELECTEDVALUE('Calendar'[Year])
)
To apply this measure as a filter, you can use it in the Filter pane by setting it in the filter section of your visuals.
Here is an example of how you might use it in a visual calculation:
SalesAmountFiltered =
CALCULATE(
SUM(Sales[SalesAmount]),
'Calendar'[Year] = [SelectedYear]
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |