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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
IF
Post Prodigy
Post Prodigy

Recent file and not showing the repeated values

Hi,

 

I have such data:

KetIDStIDTypeIDTypeLevelYesNoDateRecentLevel
K1223a3221Yes7/14/20211
K1223a3221No6/14/20210
K1223a3333Yes7/14/20211
K1223a3333No6/14/20210
K1223a3333Yes7/14/20211
K1223a4442Yes6/11/20210
K1223a4442No7/11/20211
K1222a73a1Yes6/11/20211
K1222a73a1Yes7/11/20211
K1222a63a2Yes3/11/20211
K1222a63a2Yes5/11/20211
K1323a3221No7/14/20211
K1323a3221No6/14/20211
K1323a3333Yes7/14/20210
K1323a3333No6/14/20211
K1323a3333NA7/14/20212
K1323a4442No3/11/20210
K1323a4442Yes7/11/20211
K1322a73a1Yes6/11/20211
K1322a73a1Yes7/11/20211
K1322a63a2No3/11/20210
K1322a63a2Yes5/11/20211

 

I use KetID as slicer.

 I want to see the most recent TypeID by looking at the date. If there is a repeated value (which is always the same), I want to see only one of them. 

If I select K12, the result should be:

KetIDStIDTypeIDTypeLevelYesNoDateRecentLevel
K1223a3221Yes7/14/20211
K1223a3333Yes7/14/20211
K1223a4442No7/11/20211
K1222a73a1Yes7/11/20211
K1222a63a2Yes5/11/20211

 

If I select K13, the result should be:

KetIDStIDTypeIDTypeLevelYesNoDateRecentLevel
K1323a3221No7/14/20211
K1323a3333NA7/14/20212
K1323a4442Yes7/11/20211
K1322a73a1Yes7/11/20211
K1322a63a2Yes5/11/20211

 

Thanks in advance!

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

Hi @IF ,

 

Create the following measure and put it into Filters, set show items when the value is 1.

Measure =
VAR _date =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER ( ALLSELECTED ( 'Table' ), [TypeID] = MAX ( 'Table'[TypeID] ) )
    )
VAR _rank =
    RANKX (
        FILTER ( ALLSELECTED ( 'Table' ), [TypeID] = MAX ( 'Table'[TypeID] ) ),
        CALCULATE ( SUM ( 'Table'[RecentLevel] ) ),
        ,
        DESC,
        DENSE
    )
RETURN
    IF ( _date = MAX ( 'Table'[Date] ) && _rank = 1, 1 )

1.png

 

 

 

Best Regards,

Stephen Tao

 

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
v-stephen-msft
Community Support
Community Support

Hi @IF ,

 

Create the following measure and put it into Filters, set show items when the value is 1.

Measure =
VAR _date =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER ( ALLSELECTED ( 'Table' ), [TypeID] = MAX ( 'Table'[TypeID] ) )
    )
VAR _rank =
    RANKX (
        FILTER ( ALLSELECTED ( 'Table' ), [TypeID] = MAX ( 'Table'[TypeID] ) ),
        CALCULATE ( SUM ( 'Table'[RecentLevel] ) ),
        ,
        DESC,
        DENSE
    )
RETURN
    IF ( _date = MAX ( 'Table'[Date] ) && _rank = 1, 1 )

1.png

 

 

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.