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

undefinedearlier works for me?

Hi i have a question with a formula

 

Scenario: I need to calculate if a record appear in the last 90 days based in finishtime and place true or false in a column

 

I have create a cuntom column with Finishtime - 90 named Finishtimemin90 to compare with earlier

 

Historico3 = IF(COUNTROWS(FILTER('SCS apoyo', EARLIER('SCS apoyo'[FinishTime].[Date]) > 'SCS apoyo'[FinishTimeMin90].[Date] && 'SCS apoyo'[IMEIIn]= EARLIER('SCS apoyo'[IMEIIn])))>1,TRUE,FALSE)
 
 
i have the same in SQL and que query show differents results
 
 
thank in advance
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @salespace,

I add date range compare formulas to your conditions, maybe you can try to use below formula:

Historico3 =
IF (
    COUNTROWS (
        FILTER (
            ALL ( 'SCS apoyo' ),
            [IMEIIn] = EARLIER ( 'SCS apoyo'[IMEIIn] )
                && 'SCS apoyo'[FinishTime]
                    IN CALENDAR (
                        EARLIER ( 'SCS apoyo'[FinishTime] ) - 90,
                        EARLIER ( 'SCS apoyo'[FinishTime] )
                    )
        )
    ) > 1,
    TRUE,
    FALSE
)

Regards,

Xiaoxin Sheng

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @salespace,

Maybe you can try to use following calculate Colum formula if it suitable for your requirements:

Historico3 =
IF (
    COUNTROWS (
        FILTER (
            ALL ( 'SCS apoyo' ),
            'SCS apoyo'[IMEIIn] = EARLIER ( 'SCS apoyo'[IMEIIn] )
                && 'SCS apoyo'[FinishTimeMin90].[Date] < EARLIER ( 'SCS apoyo'[FinishTime].[Date] )
        )
    ) > 1,
    TRUE,
    FALSE
)

Since we not clear for your scenario, can you please share some sample data for test if above not help?

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

thanks for your help and let me clarify, 

 

I have the historical repairs and I want to get the bounce Rate I mean if the Serial number appear in the last 3 months (90Days)

 

i Create a Custom Column calculating if the serial appear in the last 3 month, using the repair date (FinishTime) adding true o false

 

i create another column with the time interval date i mean, the date-90  (FinishtimeMin90)  <-- i think that here is the problem, earlier not comparing with the sale column using another to get the time interval, Im not sure if this works

 

 

 

 

Using SQL to same database I  get other values it is useful share que query?

 

 

 

 

 

@Anonymous 

 

 

thanks for your help and let me clarify, 

 

I have the historical repairs and I want to get the bounce Rate I mean if the Serial number appear in the last 3 months (90Days)

 

i Create a Custom Column calculating if the serial appear in the last 3 month, using the repair date (FinishTime) adding true o false

 

i create another column with the time interval date i mean, the date-90  (FinishtimeMin90)  <-- i think that here is the problem, earlier not comparing with the sale column using another to get the time interval, Im not sure if this works

 

 

 

 

Using SQL to same database I  get other values it is useful share que query?

Anonymous
Not applicable

Hi @salespace,

I add date range compare formulas to your conditions, maybe you can try to use below formula:

Historico3 =
IF (
    COUNTROWS (
        FILTER (
            ALL ( 'SCS apoyo' ),
            [IMEIIn] = EARLIER ( 'SCS apoyo'[IMEIIn] )
                && 'SCS apoyo'[FinishTime]
                    IN CALENDAR (
                        EARLIER ( 'SCS apoyo'[FinishTime] ) - 90,
                        EARLIER ( 'SCS apoyo'[FinishTime] )
                    )
        )
    ) > 1,
    TRUE,
    FALSE
)

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

What is the error you are getting

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Is not an error, only the result information is not accurate using  SQL query to same database, I  get other values

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.