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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

subtraction between the two date with filters

HELLO, HELP ME PLEASE! I have a table and I would like to do the subtraction between the two rows of dates that I have selected (in gray). But I would have to take the first date with the status "NEW" and the first date with and status "FEASIBILITY ERROR" and make the difference.I want to filter only on messages that contain "322".  and finally I would like to do this with client 1 / Value 1, client 1 / Value 2 etc, Client 2 / value 1, 2,3 etc.

Thank's a lot for your help.

 

test.PNG

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

Measure =
VAR __id = MAX ('Table'[compte] )
VAR __date1 = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[compte] = __id && 'Table'[Status] = "NEW" && search("322",'Table'[message],,0)>0)
VAR __date2 = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[compte] = __id && 'Table'[Status] = "FEASIBILITY ERROR" && search("322",'Table'[message],,0)>0)
return
datediff( CALCULATE ( min ('Table'[Date] ), VALUES ('Table'[compte] ),'Table'[compte] = __id,'Table'[Date] >= __date1 && 'Table'[Status] = "NEW" && search("322",'Table'[message],,0)>0 ) , CALCULATE ( min ('Table'[Date] ), VALUES ('Table'[compte] ),'Table'[compte] = __id,'Table'[Date] >= __date2 && 'Table'[Status] = "FEASIBILITY ERROR" && search("322",'Table'[message],,0)>0),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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.