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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Flavio2021
Frequent Visitor

Difference between date from difference table with filter

Hi 

even if some example are present I am not yet able to do the difference of date between two table, keeping the last valide value

 

As you can seen in the picture I would like made the difference of date between the date of when has been created an assistance and the last valid technical action (closed date) on the second table. The table Elevation  has 4 value, but only "remote support" and "on site" must be considerate.

 

Thank you in advance who can show how to do, using  my example

 

pbix and source data available here 

 

here print scree about result desiderated 

Flavio2021_0-1717484243992.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Flavio2021 ,

 

Create measure.

MEASURE =
VAR _max_date =
    CALCULATE (
        MAX ( 'Elevate'[Close on] ),
        FILTER (
            ALL ( Elevate ),
            'Elevate'[Ticked ID] = MAX ( 'Elevate'[Ticked ID] )
                && ( 'Elevate'[Activity] = "On site"
                || 'Elevate'[Activity] = "Remote Support" )
        )
    )
RETURN
    DATEDIFF ( MAX ( 'Ticket'[Created On] ), _max_date, DAY )

vkaiyuemsft_0-1717553510837.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

1 REPLY 1
Anonymous
Not applicable

Hi @Flavio2021 ,

 

Create measure.

MEASURE =
VAR _max_date =
    CALCULATE (
        MAX ( 'Elevate'[Close on] ),
        FILTER (
            ALL ( Elevate ),
            'Elevate'[Ticked ID] = MAX ( 'Elevate'[Ticked ID] )
                && ( 'Elevate'[Activity] = "On site"
                || 'Elevate'[Activity] = "Remote Support" )
        )
    )
RETURN
    DATEDIFF ( MAX ( 'Ticket'[Created On] ), _max_date, DAY )

vkaiyuemsft_0-1717553510837.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.