This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |