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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ronald123
Resolver III
Resolver III

Count experation days

 

Hello,

 

I'm looking for a measure for the follow issue.

 

I need the difference of total days between de exparation date and the selected date in the slicer.

In the model there's isn't an relationship between the tabels.

 

 

Printscreen.png

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Ronald123

 

Try this MEASURE

 

=
DATEDIFF (
    SELECTEDVALUE ( Calendar[Date] ),
    SELECTEDVALUE ( Invoices[ExperationDate] ),
    DAY
)

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@Ronald123

 

Try this MEASURE

 

=
DATEDIFF (
    SELECTEDVALUE ( Calendar[Date] ),
    SELECTEDVALUE ( Invoices[ExperationDate] ),
    DAY
)

Regards
Zubair

Please try my custom visuals

@Ronald123

 

or this one

 

=
VAR Start_Date =
    MIN (
        SELECTEDVALUE ( Calendar[Date] ),
        SELECTEDVALUE ( Invoices[ExperationDate] )
    )
VAR End_Date =
    MAX (
        SELECTEDVALUE ( Calendar[Date] ),
        SELECTEDVALUE ( Invoices[ExperationDate] )
    )
RETURN
    DATEDIFF ( Start_Date, End_Date, DAY )

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.