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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
manojk_pbi
Helper V
Helper V

Help - Trend chart

Hi Friends,

 

I have below data in model. How can we draw a line chart showing only Dec data of previous years and all months of the current year.

 

MMMYYForecastActualCost
6/1/202331000041813.68764
7/1/202331000075897.3089
8/1/202331000040003.10025
9/1/2023310000117452.1421
10/1/202331000056190.15467
11/1/202331000072202.93116
12/1/2023310000128021.534
1/1/20242970000
2/1/202429700027656.29
3/1/202429700043518.46
4/1/202429700068786.15
5/1/2024297000119160.89
6/1/2024297000139212.38
7/1/2024297000143467.36
8/1/2024297000163607.49
9/1/2024297000188824.68
10/1/2024297000225715.05
11/1/2024297000269808.53
12/1/2024297000296341.22
1/1/20256120000
2/1/202561200026275.19
3/1/202561200085800.02
4/1/2025612000116936.47
5/1/2025612000160379.43
6/1/2025612000187654.78
7/1/2025612000207702.24
8/1/2025612000207702.24
9/1/2025612000207702.24
10/1/2025612000207702.24
11/1/2025612000207702.24
12/1/2025612000207702.24
2 ACCEPTED SOLUTIONS
MasonMA
Super User
Super User

Hello @manojk_pbi 

 

One of the solutions would be to create one Calculated column in the table with below logic,

flag = 
VAR CurrentYear = YEAR(TODAY())
VAR RowYear = YEAR([MMMYY])
VAR RowMonth = MONTH([MMMYY])
RETURN
IF(
    RowYear = CurrentYear,                  
    TRUE(),
    IF(
        RowYear < CurrentYear,              
        RowMonth = 12,                      
        FALSE()                                 )
)

 

and use this flag column as a visual level filter as in below picture.

MasonMA_0-1755094845397.png

Hope this helps:) 

View solution in original post

Thanks for your reply. It is helpful. I am changing the graph to column chart in which we can avoid other months

View solution in original post

2 REPLIES 2
MasonMA
Super User
Super User

Hello @manojk_pbi 

 

One of the solutions would be to create one Calculated column in the table with below logic,

flag = 
VAR CurrentYear = YEAR(TODAY())
VAR RowYear = YEAR([MMMYY])
VAR RowMonth = MONTH([MMMYY])
RETURN
IF(
    RowYear = CurrentYear,                  
    TRUE(),
    IF(
        RowYear < CurrentYear,              
        RowMonth = 12,                      
        FALSE()                                 )
)

 

and use this flag column as a visual level filter as in below picture.

MasonMA_0-1755094845397.png

Hope this helps:) 

Thanks for your reply. It is helpful. I am changing the graph to column chart in which we can avoid other months

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors