Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
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
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |