Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
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.
| MMMYY | Forecast | ActualCost |
| 6/1/2023 | 310000 | 41813.68764 |
| 7/1/2023 | 310000 | 75897.3089 |
| 8/1/2023 | 310000 | 40003.10025 |
| 9/1/2023 | 310000 | 117452.1421 |
| 10/1/2023 | 310000 | 56190.15467 |
| 11/1/2023 | 310000 | 72202.93116 |
| 12/1/2023 | 310000 | 128021.534 |
| 1/1/2024 | 297000 | 0 |
| 2/1/2024 | 297000 | 27656.29 |
| 3/1/2024 | 297000 | 43518.46 |
| 4/1/2024 | 297000 | 68786.15 |
| 5/1/2024 | 297000 | 119160.89 |
| 6/1/2024 | 297000 | 139212.38 |
| 7/1/2024 | 297000 | 143467.36 |
| 8/1/2024 | 297000 | 163607.49 |
| 9/1/2024 | 297000 | 188824.68 |
| 10/1/2024 | 297000 | 225715.05 |
| 11/1/2024 | 297000 | 269808.53 |
| 12/1/2024 | 297000 | 296341.22 |
| 1/1/2025 | 612000 | 0 |
| 2/1/2025 | 612000 | 26275.19 |
| 3/1/2025 | 612000 | 85800.02 |
| 4/1/2025 | 612000 | 116936.47 |
| 5/1/2025 | 612000 | 160379.43 |
| 6/1/2025 | 612000 | 187654.78 |
| 7/1/2025 | 612000 | 207702.24 |
| 8/1/2025 | 612000 | 207702.24 |
| 9/1/2025 | 612000 | 207702.24 |
| 10/1/2025 | 612000 | 207702.24 |
| 11/1/2025 | 612000 | 207702.24 |
| 12/1/2025 | 612000 | 207702.24 |
Solved! Go to Solution.
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.
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
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.
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
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |