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
Matty
Helper II
Helper II

Highlight current week in column chart...

Hi Team,

 

I have a time series column chart in Power BI with dates along the x axis.  To help readability, a user has requested a means of highlighting the current day's date.

 

If I was to do this in Excel, I would add a vertical line using error bars to highlight the current date, but I don't think Power BI has this functionality currently.

 

Anyone manage to achieve someing akin to this in Power BI?  If so, how did you achieve it?

 

Cheers,

 

Matty  

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @Matty,

Based on my research,there is no OOTB feature to add this kind of line in Power BI charts currently. To work around the issue, you can create a measure to only show additional column bars for current week.  

1.I have entered some sample data like the picture below:

(.PNG2.

2.Create a measure.

Measure = IF(WEEKNUM(TODAY())=WEEKNUM(CALCULATE(MAX('Table1'[Date]))),CALCULATE(SUM(Table1[Value])),BLANK())

3.Create a Column chart and add the related fields, you can get the result like the picture below:

).PNG

For your requirement, you could also vote for this idea: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19550122-vertical-reference-lines...

 

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/53j7x7t7qojhrj0/Highlight%20current%20week%20in%20column%20chart.pbix?dl=0

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @Matty,

Based on my research,there is no OOTB feature to add this kind of line in Power BI charts currently. To work around the issue, you can create a measure to only show additional column bars for current week.  

1.I have entered some sample data like the picture below:

(.PNG2.

2.Create a measure.

Measure = IF(WEEKNUM(TODAY())=WEEKNUM(CALCULATE(MAX('Table1'[Date]))),CALCULATE(SUM(Table1[Value])),BLANK())

3.Create a Column chart and add the related fields, you can get the result like the picture below:

).PNG

For your requirement, you could also vote for this idea: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19550122-vertical-reference-lines...

 

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/53j7x7t7qojhrj0/Highlight%20current%20week%20in%20column%20chart.pbix?dl=0

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for responding, Daniel.

 

Your idea works, but it isn't quite what I'm after.  I have voted for idea via the link you sent.

 

Thanks again.

 

Matty 

Anonymous
Not applicable

Hi Matty,  I created two sets of values which I used to evaluate if the data is in the current week or not.

 

Current Week = if(Weekly[num]=Weekly[Current_WeeK],1,0)

Current Week  = if(Weekly[Current Week]=1,Weekly[Data_value],0)

Running= if(Weekly[Current Week]=0,Weekly[Data_Value],0)

 

Capture.JPGCapture.JPG

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.