Forum Discussion

giroldoale's avatar
giroldoale
Helper I
5 years ago
Solved

Time Axis do not limit

Hi, i have a PBI model where I need to show a Line Chart having 2 measures over the Time. Then in the table called Calendar 2, use to build a rolling calendar, I calculate a tag "YTD" to limit all ...
  • v-robertq-msft's avatar
    5 years ago

    Hi, giroldoale 

    According to your description, I can understand your desription, I’ve also created some data to get your expected output, you can take a look my steps:

    I created a measure in the data table like this:

    Sum =
    IF(
        SELECTEDVALUE('Table (2)'[YTD])="YTD",
        IF(
        MAX('Table'[Date1])<=TODAY(),
        SUM('Table'[Amount]),BLANK()),
        SUM('Table'[Amount]))

    Then I created a line chart and two slicers and place them like this:

     

    Then I can the line chart automatically disappear the date from start of year to today if I selected “2021” in the date slicer.

    If you want to get a dot line after the current day, you can go to the “Analytics” pane of the setting and add a forecast chart like this:

     

    And you can get what you want.

    What’s more, you can also set the start and end date of your X-Axis manually here:

    For more detail, you can download my test pbix file here

     

    If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

     

    Best Regards,

    Community Support Team _Robert Qin

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.