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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Colorizing/formatting a line up to today's date

I want to color the line of a chart up to a defined date. The rest of the line should be dashed.
For this I have already created two lines and superimposed them to format them differently. However, the end of the first line is disturbing, because a horizontal line is created.
Is it possible to hide the tail? or to format the same line to defined data sections?

morinow_0-1672154355562.png

 

3 REPLIES 3
ppm1
Solution Sage
Solution Sage

You can hide the blue "tail" by updating your measure so it returns blank for those points (e.g., Year > 2023 or Date > TODAY()).


Pat

Microsoft Employee
Anonymous
Not applicable

Thank you for your message @ppm1 . What should I change?

 
Running Total Cost Today =
CALCULATE (
    SUM ( PCT[Actual Total Cost (€)] ),
    FILTER (
        ALLSELECTED ( 'PCT' ),
        'PCT'[Period] <= MAX ( 'PCT'[Period] )
            && 'PCT'[Period].[Date] <= TODAY ()
    )
)

Please try this measure instead. Note also that filtering a whole table is not best practice, so I removed that too.

Running Total Cost Today =
VAR maxdate =
    MAX ( 'PCT'[Period] )
RETURN
    IF (
        maxdate <= TODAY (),
        CALCULATE ( SUM ( PCT[Actual Total Cost (€)] ), 'PCT'[Period] <= maxdate )
    )

Pat

Microsoft Employee

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors