Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KendallBrown13
Frequent Visitor

Time Intelligence

I have a unique issue that I'm hopeful someone on this forum can help me answer. 

 

Here is an image of my dashboard. 

KendallBrown13_0-1660052589145.png

Here is the issue at hand - when I filter the Year slicer in the top left corner, the rest of the dashboard filters properly except for the chart. The chart has two bars and two lines, one for the current period and one for last year same period. When I change the year to say 2020, the previous year line in the chart disappears. 

KendallBrown13_1-1660052793771.png

What I want to happen is for the Year Slicer in the top corner to be representative of "current year". Meaning that when that slicer is changed to reflect a year, that the graph on the bottom uses the that year minus one as the previous period. 

 

Hoping someone knows how to fix this! 


Thanks!

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @KendallBrown13 ,

There're two possible reasons why the previous year value disappear, first maybe it return blank, which because of there's no value in the previous year in the sample or a incorrect formula, second maybe the previous year value and the current year value coincide. You can convert the chart to a table visual to see the specific value.

Additionally, the MonthYear column in your sample is already a date format and does not need to add .[Date] after it in the formula.

I create a sample and here's my solution.

Pre =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[MonthYear]
            = DATE ( YEAR ( SELECTEDVALUE ( 'Table'[MonthYear] ) ) - 1, MONTH ( MAX ( 'Table'[MonthYear] ) ), DAY ( MAX ( 'Table'[MonthYear] ) ) )
    )
)

It get correct result in my sample.

vkalyjmsft_0-1660637541535.png

 

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yanjiang-msft
Community Support
Community Support

Hi @KendallBrown13 ,

There're two possible reasons why the previous year value disappear, first maybe it return blank, which because of there's no value in the previous year in the sample or a incorrect formula, second maybe the previous year value and the current year value coincide. You can convert the chart to a table visual to see the specific value.

Additionally, the MonthYear column in your sample is already a date format and does not need to add .[Date] after it in the formula.

I create a sample and here's my solution.

Pre =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[MonthYear]
            = DATE ( YEAR ( SELECTEDVALUE ( 'Table'[MonthYear] ) ) - 1, MONTH ( MAX ( 'Table'[MonthYear] ) ), DAY ( MAX ( 'Table'[MonthYear] ) ) )
    )
)

It get correct result in my sample.

vkalyjmsft_0-1660637541535.png

 

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@KendallBrown13 , Hope you are using a date table and measure like

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

Slicer and visual should use the period from date table.

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This first screenshot is the output for the Chart in the Dashboard. 

KendallBrown13_0-1660062575745.png

These are the formulas for the two calculated fields. The LY Sales is for the bars and the LY Cost of Sales is for the lines. 

KendallBrown13_2-1660063074444.png

KendallBrown13_3-1660063092411.png

 

 

This next screenshot is for the matrix in the top left corner.  

KendallBrown13_1-1660062826502.png

 

Please let me know if this is enough information! It would take a lot of time for me to clean the pbix file but if that's required I can do so. 

 

@KendallBrown13 , Join your month year date column with the date table and then create the measure. Make sure slicer and visual also use the period from date table

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I don't have a date table in my model. Is there a recommended way I should set this up? 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors