Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Show current year

I am preparing a header for my power bi report in the following way

 

Sales for the year 2020 - question is how do I show the year dynamically ? Can I add a new column to the report in the power bi desktop that just shows current year ?

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try this:

Measure =
"My header -" & FORMAT ( TODAY (), "mmmyyyy" )

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi @Anonymous,

 

Showing current year in header for report can be done with help if DAX measure and Card visual.

DAX measure: 

Report Header = "Sales for the year " & YEAR ( TODAY () )
 
Please note doing this, only header will get the value for current year, and data will be shown as per the slicers selected.
You can also think of using below DAX measure to dynamically change the year value in header, with change in the selected Year.
DAX Measure:
Report Header = "Sales for the year " & SELECTEDVALUE( 'Calendar'[Year] , "Multiple Years" )
 
Romil

If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.

Anonymous
Not applicable

I am using card visual and a measure in the table, so good thing is, even though there is no data in the report I can see the header

 

Measure = "My header -"& format(month(today()),"mmm") & year(today())
 
why is it showing Jan2020 ? why not current month ?
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try this:

Measure =
"My header -" & FORMAT ( TODAY (), "mmmyyyy" )

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

Anonymous
Not applicable

You mean create a new dax measure column which is static ?

Anonymous
Not applicable

Hi @Anonymous,

 

Showing current year in header for report can be done with help if DAX measure and Card visual.

DAX measure: 

Report Header = "Sales for the year " & YEAR ( TODAY () )
 
Please note doing this, only header will get the value for current year, and data will be shown as per the slicers selected.
You can also think of using below DAX measure to dynamically change the year value in header, with change in the selected Year.
DAX Measure:
Report Header = "Sales for the year " & SELECTEDVALUE( 'Calendar'[Year] , "Multiple Years" )
 
Romil

If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.

PhilipTreacy
Super User
Super User

Hi @Anonymous 

I'm not sure if you mean you want to show the current year i.e. 2020, or the currently selected year?

And do you want the heading to read Sales for the year 2020 ?

Please clarify.  If you just want the current year (2020) this measure will do

 

Current Year = CONCATENATE("Sales for the Year ", FORMAT(TODAY(),"yyyy"))

 

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

so here is the requirement, It doesnt have to do anything with the data, 

In my power bi heading for the report, I just want to show 

 

sales report - November 2020 

 

The month and year should always show current month and year....thats all, nothing fancy, I can write oracle function to display this information in the oracle view i am using as source, but if there is no data for the month it would be empty....can I use dax somehow in the power bi header to show this info ? (maybe in a card ?) , dont want to invovle data table etc

camargos88
Community Champion
Community Champion

@Anonymous ,

 

Perhaps a card with measure returning que current year works.

Can you provide more details ?



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

so here is the requirement, It doesnt have to do anything with the data, 

In my power bi heading for the report, I just want to show below in the header of report whether there is data or not

 

sales report - November 2020 

 

The month and year should always show current month and year....thats all, nothing fancy, I can write oracle function to display this information in the oracle view i am using as source, but if there is no data for the month it would be empty....can I use dax somehow in the power bi header to show this info ? (maybe in a card ?) , dont want to invovle data table etc

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors