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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Dynamic Reference line to indicate today's date

Hi,

I am trying to create a bar chart with a dynamic reference line, Can you please help me in acheving it.

 

In the x axis I will have values like -Q1. -Q2, -Q3, -Q4, Q1, Q2, Q3, Q4. This can be in months as well if drill down. Now I need a vertical reference line to indicate today's date (report logged in effective date). for example if I logged into the report today the line should be on Q1, If logged in on April then it should be on Q2. Can you please advise how this can be managed? I know I can achevie this via shapes but that's static, so I need something dynamic according to the user logged in date.

Thanks for your help

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi,  @Anonymous 

 

A vertical reference line is not available now. 

To work around this requirement, you can try to use a combination chart.You can refer to this article:

https://community.powerbi.com/t5/Desktop/Dynamic-date-vertical-reference-line-or-a-dot-in-a-line-chart/m-p/603550 

 

And here is a sample I made:

5.png

https://wicren-my.sharepoint.com/:u:/g/personal/michael_wicren_onmicrosoft_com/ERSq0fkx5U1Bor4-qEISrMwBbZ-Ee5Lj3aHzEf6pS1iVWA?e=feQnCQ 

 

You need  to create a measure as below and add it to line and stacked column chart:

Line2 =
VAR y =
    YEAR ( TODAY () )
VAR m =
    FORMAT ( TODAY (), "MMMM" )
VAR quar =
    FORMAT ( TODAY (), "q" )
VAR q = "Qtr " & quar
VAR d =
    DAY ( TODAY () )
RETURN
    IF (
        ISINSCOPE ( financials[Date].[Day] ),
        IF (
            d IN FILTERS ( 'financials'[Date].[Day] )
                && m IN FILTERS ( 'financials'[Date].[Month] )
                && q IN FILTERS ( 'financials'[Date].[Quarter] )
                && y IN FILTERS ( 'financials'[Date].[Year] ),
            1,
            0
        ),
        IF (
            ISINSCOPE ( financials[Date].[Month] ),
            IF (
                m IN FILTERS ( 'financials'[Date].[Month] )
                    && q IN FILTERS ( 'financials'[Date].[Quarter] )
                    && y IN FILTERS ( 'financials'[Date].[Year] ),
                1,
                0
            ),
            IF (
                ISINSCOPE ( financials[Date].[Quarter] ),
                IF (
                    q IN FILTERS ( 'financials'[Date].[Quarter] )
                        && y IN FILTERS ( 'financials'[Date].[Year] ),
                    1,
                    0
                ),
                IF (
                    ISINSCOPE ( financials[Date].[Year] ),
                    IF ( y IN FILTERS ( 'financials'[Date].[Year] ), 1, 0 )
                )
            )
        )
    )

 

Best Regards,
Community Support Team _ Eason
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

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi,  @Anonymous 

 

A vertical reference line is not available now. 

To work around this requirement, you can try to use a combination chart.You can refer to this article:

https://community.powerbi.com/t5/Desktop/Dynamic-date-vertical-reference-line-or-a-dot-in-a-line-chart/m-p/603550 

 

And here is a sample I made:

5.png

https://wicren-my.sharepoint.com/:u:/g/personal/michael_wicren_onmicrosoft_com/ERSq0fkx5U1Bor4-qEISrMwBbZ-Ee5Lj3aHzEf6pS1iVWA?e=feQnCQ 

 

You need  to create a measure as below and add it to line and stacked column chart:

Line2 =
VAR y =
    YEAR ( TODAY () )
VAR m =
    FORMAT ( TODAY (), "MMMM" )
VAR quar =
    FORMAT ( TODAY (), "q" )
VAR q = "Qtr " & quar
VAR d =
    DAY ( TODAY () )
RETURN
    IF (
        ISINSCOPE ( financials[Date].[Day] ),
        IF (
            d IN FILTERS ( 'financials'[Date].[Day] )
                && m IN FILTERS ( 'financials'[Date].[Month] )
                && q IN FILTERS ( 'financials'[Date].[Quarter] )
                && y IN FILTERS ( 'financials'[Date].[Year] ),
            1,
            0
        ),
        IF (
            ISINSCOPE ( financials[Date].[Month] ),
            IF (
                m IN FILTERS ( 'financials'[Date].[Month] )
                    && q IN FILTERS ( 'financials'[Date].[Quarter] )
                    && y IN FILTERS ( 'financials'[Date].[Year] ),
                1,
                0
            ),
            IF (
                ISINSCOPE ( financials[Date].[Quarter] ),
                IF (
                    q IN FILTERS ( 'financials'[Date].[Quarter] )
                        && y IN FILTERS ( 'financials'[Date].[Year] ),
                    1,
                    0
                ),
                IF (
                    ISINSCOPE ( financials[Date].[Year] ),
                    IF ( y IN FILTERS ( 'financials'[Date].[Year] ), 1, 0 )
                )
            )
        )
    )

 

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors