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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Syndicate_Admin
Administrator
Administrator

Verification between dates

Let's imagine that I have the following table:

Codecod_intdate
CT1seg_client1/4/2024
CT1seg_client3/6/2024
CT1seg_client18/6/2024
CT2seg_client3/3/2024

I also have the following measurement;

# Clientes con visitas fuera de rango = 
 CALCULATE(
    COUNTROWS('MovInteracciones_sql'),
    (('MovInteracciones_sql'[Date] < DATE(2024, 6, 1) || MovInteracciones_sql[Date] > DATE(2024,6,15) ) && MovInteracciones_sql[Interaction Template Code]="SEG_CLIENT" 
))

Well, what this measurement does is check if there are any CTs with a visit lower on the 1/6 date and higher than 15/6. But what I need that I don't know how to do, is to verify that between the dates there is no visit, if there is the CT should not appear on the list.

In the end my final inquiry should come out

CT2 -> has a visit less than 1/6 or more than 15/6 and has no visit between those two (1/6 to 15/6)

Thank you.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from @amitchandak , please allow me to provide another insight: 


Hi  @Syndicate_Admin ,

Here are the steps you can follow:

1. Create measure.

Measure =
var _column=
SELECTCOLUMNS(
    FILTER(ALL('MovInteracciones_sql'),
    'MovInteracciones_sql'[date]>=DATE(2024,6,1) && 'MovInteracciones_sql'[date]<=DATE(2024,6,15)&&'MovInteracciones_sql'[cod_int]="seg_client"),"test",[Code])
return
CALCULATE(
    COUNTROWS(
        'MovInteracciones_sql'),
        FILTER('MovInteracciones_sql',
        NOT('MovInteracciones_sql'[Code]) in _column)
)

2. Result:

vyangliumsft_0-1718954158272.png

 

 

Best Regards,

Liu Yang

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

3 REPLIES 3
Anonymous
Not applicable

Thanks for the reply from @amitchandak , please allow me to provide another insight: 


Hi  @Syndicate_Admin ,

Here are the steps you can follow:

1. Create measure.

Measure =
var _column=
SELECTCOLUMNS(
    FILTER(ALL('MovInteracciones_sql'),
    'MovInteracciones_sql'[date]>=DATE(2024,6,1) && 'MovInteracciones_sql'[date]<=DATE(2024,6,15)&&'MovInteracciones_sql'[cod_int]="seg_client"),"test",[Code])
return
CALCULATE(
    COUNTROWS(
        'MovInteracciones_sql'),
        FILTER('MovInteracciones_sql',
        NOT('MovInteracciones_sql'[Code]) in _column)
)

2. Result:

vyangliumsft_0-1718954158272.png

 

 

Best Regards,

Liu Yang

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

It seems to be going great. Thank you!

amitchandak
Super User
Super User

@Syndicate_Admin ,

Assuming this counting the client visited # Clientes con visitas fuera de rango

 

Not visited

Countx(Values(MovInteracciones_sql[cod_int]), if (isblank([# Clientes con visitas fuera de rango] ), [cod_int], blank() ))

 

 

Or try like

 

Clientes Sin Visitas en Rango =
VAR DateStart = DATE(2024, 6, 1)
VAR DateEnd = DATE(2024, 6, 15)

RETURN
CALCULATE(COUNTROWS(DISTINCT('MovInteracciones_sql'[Code])),
FILTER('MovInteracciones_sql','MovInteracciones_sql'[Interaction Template Code] = "SEG_CLIENT" &&
NOT(CALCULATE(COUNTROWS('MovInteracciones_sql'),'MovInteracciones_sql'[Date] >= DateStart && 'MovInteracciones_sql'[Date] <= DateEnd
) > 0)),'MovInteracciones_sql'[Date] < DateStart || 'MovInteracciones_sql'[Date] > DateEnd)

 

very similar tot lost customer

Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://youtu.be/EyL7KMw877Q

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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