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
beepboop
Frequent Visitor

Problem with previous month data visual where date slicer filters by year

I have 3 visuals that compare previous month data. I have a slicer that filters the selected year (2022, 2023, current year (2024)) and this slicer will affect all the visuals on the page. There are currently no page filters. On the visuals, I have set 3 categories for data (previous month visual where it is filtered by relative date - in the last 1 calendar month , current month visual filtered by relative date - in this month, ytd visual that has no filters but i applied a specific measure for the data). The current and ytd visuals are working as expected. However, the previous month visual is not working when we are in January 2024. It is suppose to display December 2023 data but it says 0. On the visual, I am using a measure where a USERELATIONSHIP is being used with the date table. I think I will have to amend this measure but I am certain it has something with how the USERELATIONSHIP function is setup.

 

For context, this is the measure

 

# items by customer = COALESCE(CALCULATE(COUNT(cust_table[Id]),FILTER(cust_table,cust_table[status_new] <> "Already approached" && cust_table[business] = "New"), USERELATIONSHIP(cust_table[date_received], 'date'[date]), USERELATIONSHIP(cust_table[employee], 'User Profile (2)'[Name])),0)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@beepboop , Make sure the slicer and visual use period from the date table. Try measures like

 

# items by customer = CALCULATE(COUNT(cust_table[Id]),FILTER(cust_table,cust_table[status_new] <> "Already approached" && cust_table[business] = "New"), USERELATIONSHIP(cust_table[date_received], 'date'[date]), USERELATIONSHIP(cust_table[employee], 'User Profile (2)'[Name]))

 

Last month = calculate([# items by customer], dateadd('date'[date],-1, month))


Previous month = calculate([# items by customer], previousmonth('date'[date]))

 

 

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...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @beepboop ,

 

Did @amitchandak  reply solve your problem? If so, please mark it as the correct solution, and point out if the problem persists.

 

Best Regards,
Adamk Kong

 

 

amitchandak
Super User
Super User

@beepboop , Make sure the slicer and visual use period from the date table. Try measures like

 

# items by customer = CALCULATE(COUNT(cust_table[Id]),FILTER(cust_table,cust_table[status_new] <> "Already approached" && cust_table[business] = "New"), USERELATIONSHIP(cust_table[date_received], 'date'[date]), USERELATIONSHIP(cust_table[employee], 'User Profile (2)'[Name]))

 

Last month = calculate([# items by customer], dateadd('date'[date],-1, month))


Previous month = calculate([# items by customer], previousmonth('date'[date]))

 

 

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...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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