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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
saanah2019
Helper II
Helper II

Days between on slicer


I have one table with id, first day, last day, visit type and I want to make a calculated column (last day - first day) which shows the minimum for each visit regardless of the visit types chosen

 

So I have this so far: 

 

visit idfirst datelast datevisit typedays between(calculated column)
1001/1/20181/8/2018Session7
1001/2/20181/10/2018Orientation8
1011/3/20181/15/2018Session12
1011/4/20181/11/2018Peer7
1021/5/20181/23/2018Peer18
1031/6/20181/23/2018Group17
1031/7/20182/14/2018Individual38
1031/8/20181/16/2018Peer

8

 

 

 

 

But I want to only show 

 

visit idfirst datelast datevisit typedays between
1001/1/20181/8/2018Session7
     
     
1011/4/20181/11/2018Peer7
1021/5/20181/23/2018Peer18
     
     
1031/8/20181/16/2018Peer8

 

So basically, the end user can select any visit type and the file will find the least days between date and visit type and show that only.

 

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @saanah2019 ,

You can consider to create a measure to compare with current row content if it is last records and return tag. You can use this on visual level filter to filter unmatched records.

First Records =
VAR currlast =
    MAX ( T2[last date] )
VAR _last =
    CALCULATE ( MIN ( T2[last date] ), ALLSELECTED ( t2 ), VALUES ( T2[visit id] ) )
RETURN
    IF ( currlast = _last, "Y", "N" )

6.png

Regards,

XIaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @saanah2019 ,

You can consider to create a measure to compare with current row content if it is last records and return tag. You can use this on visual level filter to filter unmatched records.

First Records =
VAR currlast =
    MAX ( T2[last date] )
VAR _last =
    CALCULATE ( MIN ( T2[last date] ), ALLSELECTED ( t2 ), VALUES ( T2[visit id] ) )
RETURN
    IF ( currlast = _last, "Y", "N" )

6.png

Regards,

XIaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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