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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How can I display visits from last year in a line chart in Power BI?

Hi everyone,

 

I'm working on a line chart in Power BI that shows the number of visits to our website over time, with the chart currently set up to display visits by day in 2023. I'm using a measure called "Unique Visits" to calculate the distinct count of visit IDs from our website data source.

I'd like to compare the visits from the same time period in the previous year (i.e. January 2022 through December 2022) to the visits this year, but I'm having trouble getting the visits from last year to display in the chart. I've tried creating a new measure using the DATEADD function to subtract a year from the date, but this hasn't worked.

Here's the formula I used for the new measure:

 

 
Unique Visits Last Year = CALCULATE( DISTINCTCOUNT('Website Data'[Visit ID]), DATEADD('Website Data'[Date], -1, YEAR) )

Can anyone help me figure out why the visits from last year aren't displaying in the chart?

P.s. I also have a filter on the page that has selected the period of first quarter of 2023.

See picture below:

LaZZaNoVa61_0-1679829312362.png

 

0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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