Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |