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
Syndicate_Admin
Administrator
Administrator

Problem with date range

Good morning.

I have a mess, I hope you can help me solve.

Context: I have 2 tables, 1 with services given to a client (food, drink, hotel, car, etc.), and the other with the client's status (solvent, delinquent, overdrawn, new), these statuses can last for some time, that is, they have start_date and have end_date.

Problem:
I need to know the status that the client had when receiving the service. But since it is a range, when I select a month I get only those that had change that month.

IDStart_dateEND_DATESTATUS
CLI00101/01/202210/03/2022SOLVENT
CLI00115/02/202225/04/2022DEFAULTING
CLI00105/05/202210/07/2022SOBREGIRADO
CLI00401/01/202201/02/2022NEW

Suppose that cli001 received services on 02/25/2022 and 06/16/2022, both dates correspond to different ranges, but how can I capture them?

Note: I cannot "fill" the day-to-day date ranges with the missing dates because the date ranges are huge and the number of clients exceeds 2 thousand.
Although it gets heavy, I was able to join the 2 tables by the ID, but I have not been able to determine what status I had when I received the service...

Thanks in advance...

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Fix it this way:

MODALITY RESULT =

IF(START_DATE > STATUS_DATE,

"N/A",

//else

IF(STATUS_DATE >= START_DATE

&& STATUS_DATE <= END_DATE,

"APPLY","N/A"))

v-zhangti
Community Support
Community Support

Hi, @Syndicate_Admin 

 

You can try the following methods.
New table:

Date = CALENDAR(MIN('Table'[Start_date]),MAX('Table'[END_DATE]))
Measure =
IF ( SELECTEDVALUE ( 'Date'[Date] ) = BLANK (), 1,
    IF ( SELECTEDVALUE ( 'Date'[Date] ) >= SELECTEDVALUE ( 'Table'[Start_date] )
            && SELECTEDVALUE ( 'Date'[Date] ) <= SELECTEDVALUE ( 'Table'[END_DATE] ),
        1,
        0
    )
)

 Put measure in the filter of this view and set it equal to 1.

vzhangti_0-1677652484722.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.