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.
How would you create a dynamic text that states to put the previous year if it's Q1?
Solved! Go to Solution.
Hi @agd50 ,
We can create a measure.
Dynamic Year Title =
VAR CurrentDate = TODAY()
VAR CurrentYear = YEAR(CurrentDate)
VAR CurrentQuarter = QUARTER(CurrentDate)
RETURN
IF(CurrentQuarter = 1, FORMAT(CurrentYear - 1, "0"), FORMAT(CurrentYear, "0"))
This formula checks the current date and determines the quarter. If it's the first quarter (Q1), the formula subtracts one year from the current year to display the previous year. Otherwise, it displays the current year.
Go to the visual where you want to display the dynamic title. In the "Format" pane, find the "Title" section. Click on the "fx" button to enable conditional formatting. Choose "Format by" as "Field value" and select the measure you created.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @agd50 ,
We can create a measure.
Dynamic Year Title =
VAR CurrentDate = TODAY()
VAR CurrentYear = YEAR(CurrentDate)
VAR CurrentQuarter = QUARTER(CurrentDate)
RETURN
IF(CurrentQuarter = 1, FORMAT(CurrentYear - 1, "0"), FORMAT(CurrentYear, "0"))
This formula checks the current date and determines the quarter. If it's the first quarter (Q1), the formula subtracts one year from the current year to display the previous year. Otherwise, it displays the current year.
Go to the visual where you want to display the dynamic title. In the "Format" pane, find the "Title" section. Click on the "fx" button to enable conditional formatting. Choose "Format by" as "Field value" and select the measure you created.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide a more detailed information. What does Q1 refer to? - today's date or the selected date in a slicer? Do you have separate dates table or you're using the fact table?
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 |
---|---|
66 | |
59 | |
49 | |
36 | |
35 |
User | Count |
---|---|
84 | |
70 | |
58 | |
45 | |
44 |