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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Dunner2020
Post Prodigy
Post Prodigy

Showing dates as legend of the graph

Hi there,

 

I have a report that contains a fact table and two dimension tables (i.e. date and time). I am plotting three line graphs (for today, yesterday, and day before yesterday) that shows average temperature during 24 hours. Example is shown below:

 

Dunner2020_0-1657669125109.png

I calculated three measures to calculate the average temperature. For example: today temperature measure looks as follow:

Today = CALCULATE(AVERAGE(Fact[TEMPERATURE]),Dates[Date]= TODAY())

Now I want to change the legend of the chart with the actual dates. For instance, instead of today, it should show the date (i.e. 13/7/2022). I am not sure how to bring in the date as a legend. Any help would be really appreciated. Thanks

3 REPLIES 3
amitchandak
Super User
Super User

@Dunner2020 , Based on what I got. You need a column like this and use that as a legend

 

Date Type = SWITCH(TRUE(),'Date'[Date]=TODAY(),"Today"
,'Date'[Date]=TODAY()-1,"Yesterday"
,'Date'[Date]=TODAY()-2,"Day before Yesterday"
,'Date'[Date]&"")

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

@amitchandak , I want to show dates as legend not the text. Instead of showing Today, I want to show today's date

@Dunner2020 , the Last three days of data

Check if this measure can help

oday = CALCULATE(AVERAGE(Fact[TEMPERATURE]),filter(Dates, Dates[Date]>= TODAY()-2 && Dates[Date]<= TODAY()) )

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.