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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BarSi1986
Helper I
Helper I

Can i use current date (month and year) as a part of column name in DAX

Dear All,

 

I want to include current date - month + year in following format: ["some text" & current month-current year] as a Custom Measure Name in my power bi project =- i need to achieve dynamic column (measure) names depending on current date, for example:

sales value - January 2021, sales value - February-2021

i did this in power Query like below: 

 "sales value - "  &   Date.ToText(Date.From(DateTime.LocalNow()), "MMMM/yyyy")

but i need to achieve it in BI Desktop cause i need the name for custom measure

 

any ideas ?

 

1 ACCEPTED SOLUTION

@BarSi1986  as far as I know it is not possible to dynamically change the  name/header of the measure

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

7 REPLIES 7
smpa01
Super User
Super User

@BarSi1986  try this measure

Measure= "sales value - "&FORMAT(TODAY(),"mmmm/yyyy")
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

but i don't want to have it in my ROWS, i neend to have dynamically changing HEADER of this custom measure column - values need to be calculated as i will do it, but i need DATE to be a part o NAME/HEADER of this column

@BarSi1986  sorry are you desiring for a measure that dynamically changes the HEADER/NAME of the measure?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

of course,

 

it should look like this: 

BarSi1986_0-1640014349427.png

 

but the headers can;t be hardcoded as a text - month name should dynamically change with formula

something like that i achieved in power query using: 

 

"sales value - "  &   Date.ToText(Date.From(DateTime.LocalNow()), "MMMM")

need to achieve the same in DAX

@BarSi1986  as far as I know it is not possible to dynamically change the  name/header of the measure

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
amitchandak
Super User
Super User

@BarSi1986 , Are you looking for a column like

 

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

 

 

Month Type = Switch( True(),
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I don;t exactyl know actually, can u show me how can i use it as a Custom Measure Column name - i mean as a header of custom measure column ?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.