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

Days Since Event

Hello,

 

I'm trying to create a column chart for Days Since Event, filtered by states.  I have four states to filter through.  I know I need to use the DateDiff function, but I'm having a problem filtering by a particular state.  Any advice?

 

cborde3_0-1674496819577.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @cborde3 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Measure = DATEDIFF(MIN('Table'[Incident Date]),TODAY(),DAY)

yingyinr_0-1674626916197.png

If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format, your column chart field settings and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @cborde3 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Measure = DATEDIFF(MIN('Table'[Incident Date]),TODAY(),DAY)

yingyinr_0-1674626916197.png

If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format, your column chart field settings and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Thank you.  This resolved it.

amitchandak
Super User
Super User

@cborde3 , Not very clear, But earlier can help

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

 

You can get the last date and take diff

 

new column =

var _max = maxx(filter(table, [Pcrs reference] = earlier([Pcrs reference])  && [Date]< earlier([Date]) ), [Date])

return

datediff(_max, [Date], day)

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
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.