Hello,
I'm working with dynamic titles for the first time and I'm wondering if it is possible to:
1. display only the year in the title if the data of the year is complete
2. display the months or last month with data if the data of the year is not complete
I have now a dynamic title that shows the year that is selected. For 2019, 2020 and 2021 this is perfect.
But for 2022 I would like to have 'jan - oct 2022' or '01/01/2022 - 31/10/2020' or something like that that indicates that the year is not complete.
Solved! Go to Solution.
Hi @boa ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Flag =
var _select=SELECTEDVALUE('Table'[Date].[Year])
var _mindate=
MINX(FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))),[Date])
var _maxdate=
MAXX(FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))),[Date])
return
IF(
_select=2022,
_mindate &"-"& _maxdate,
_select&""&"")
2. Visualizations – Title – Text –fx.
3. Result:
Select 2021:
Select 2022:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @boa ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Flag =
var _select=SELECTEDVALUE('Table'[Date].[Year])
var _mindate=
MINX(FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))),[Date])
var _maxdate=
MAXX(FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))),[Date])
return
IF(
_select=2022,
_mindate &"-"& _maxdate,
_select&""&"")
2. Visualizations – Title – Text –fx.
3. Result:
Select 2021:
Select 2022:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Dynamic title is normal, there are some existing solutions in the community,
https://community.powerbi.com/t5/Desktop/Dynamic-Title-based-on-Visualization-filter/td-p/1725909
https://community.powerbi.com/t5/Desktop/Dynamic-title-with-date-filter/td-p/1925613
Hi @boa
Try below measure and adjust the field names according to your dataset
Title = if( selected value ( 'table'[year])=year(today()), min(date) && " - " && max(date), max(year))
If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
User | Count |
---|---|
119 | |
75 | |
65 | |
51 | |
51 |
User | Count |
---|---|
184 | |
104 | |
82 | |
79 | |
78 |