Forum Discussion
Display future dates
- 4 years ago
Hi Chetcork
Your assumption is correct that future dates in datetable are necessary. At least the datetable should have dates till the end of 2022. Then you can use measures like below and put them into the line chart.
This Year = CALCULATE(SUM('Table'[Value]),'Date'[Year]=2022)Last Year = CALCULATE(SUM('Table'[Value]),'Date'[Year]=2021)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Chetcork ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hi,
I cannot share pbix file, but we can work on below sample data. I want line chart displaying only year 2022 from january to december that contains last year data and current data. Dates in my datetable are queried from sql therfore max date is forced on refresh of dataset
| 01.01.2021 | 25 |
| 01.02.2021 | 50 |
| 01.03.2021 | 13 |
| 01.04.2021 | 12 |
| 01.05.2021 | 67 |
| 01.06.2021 | 90 |
| 01.07.2021 | 32 |
| 01.08.2021 | 120 |
| 01.09.2021 | 35 |
| 01.10.2021 | 11 |
| 01.11.2021 | 12 |
| 01.12.2021 | 90 |
| 01.01.2022 | 87 |
| 01.02.2022 | 28 |
| 01.03.2022 | 12 |
| 01.04.2022 | 12 |
- v-jingzhang4 years agoCommunity Support
Hi Chetcork
Your assumption is correct that future dates in datetable are necessary. At least the datetable should have dates till the end of 2022. Then you can use measures like below and put them into the line chart.
This Year = CALCULATE(SUM('Table'[Value]),'Date'[Year]=2022)Last Year = CALCULATE(SUM('Table'[Value]),'Date'[Year]=2021)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.