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
sibredcat
Regular Visitor

filter out old data

Hi All

 

I have a dataset of the following format:

CustomerTimeStatus
Aa1ok
Bb1ok
Cc1nok
Aa2ok
Bb2ok
Cc2ok

This is a live connection dataset, the new data for every customer is coming in every 2 minutes from Azure Stream Analytics. For example, a2-a1=2 mins, but a1 is not the current time, so I can't just filter out all data older than 2 minutes. a1, b1, c1 is in different timezones, but I can convert it to UTC via a measure. Since this is a live dataset, no usage of columns is possible.

 

My question is how can I remove the duplicates from the customer column in such  way that:

- I always have the most recent data for a customer

- In the case when the data with time a1 doesn't come in, the previous one with time a2 is shown. The customers shouldn't disappear completely.

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sibredcat ,

 

Make your visual filtered by the measure as below.

Measure = 
VAR maxdate =
    CALCULATE (
        MAX ( 'Table_onpre'[date] ),
        ALLSELECTED ( Table_onpre ),
        VALUES ( Table_onpre[value] )
    )
VAR c =
    MAX ( 'Table_onpre'[date] )
RETURN
    IF ( maxdate = c, 1, BLANK () )

 2.PNG

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @sibredcat ,

 

Make your visual filtered by the measure as below.

Measure = 
VAR maxdate =
    CALCULATE (
        MAX ( 'Table_onpre'[date] ),
        ALLSELECTED ( Table_onpre ),
        VALUES ( Table_onpre[value] )
    )
VAR c =
    MAX ( 'Table_onpre'[date] )
RETURN
    IF ( maxdate = c, 1, BLANK () )

 2.PNG

 

Thank you so much! It's working perfectly!

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.