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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Problem with DATESINPERIOD

I have created a DAX measure that repeatedly fails to return any results. I have used the same DAX code previously for another measure, and it worked correctly. The only differences are the tables being used. All tables are correctly related, and the date fields are in the same format.

Another difference is that in the current measure, I am attempting to use two tables. However, even when I simplify the measure to use only one table (e.g., only the 'CORRECT' table), it still does not work. There are indeed records that meet the three filters ('Taak afgerond' = "nee", 'Vandaag is na streefeinddatum taak' = "ja", and 'Zaak actief' = "ja"), so the issue seems to lie with the DATESINPERIOD function.

Can anyone see what the problem is?
This is the DAX code:

 

%openstaande taken_maand =
VAR EersteDatumCorrect =
CALCULATE(
MIN('zaken-taak-team CORRECT'[taak.begindatum]),
NOT(ISBLANK('zaken-taak-team CORRECT'[taak.begindatum]))
)//Enkel gebruikt om de eerste datum ontvangst zaaksysteem te bepalen die niet NULL is. Wil de NULL values echter niet uitsluiten in measure zelf

 

VAR ZakenIncompleetCorrect =
CALCULATE(
COUNTROWS('zaken-taak-team CORRECT'),
'zaken-taak-team CORRECT'[Taak afgerond] = "nee",
'zaken-taak-team CORRECT'[Vandaag is na streefeinddatum taak] = "ja",
'zaken-taak-team CORRECT'[Zaak actief] = "ja",
DATESINPERIOD(
dimDate[Date],
EersteDatumCorrect,
1,
MONTH
)
)

 

VAR TotaalIncompletezakenCorrect =
CALCULATE(
COUNTROWS('zaken-taak-team CORRECT'),
DATESINPERIOD(
dimDate[Date],
EersteDatumCorrect,
1,
MONTH
)
)

 

VAR EersteDatumFout =
CALCULATE(
MIN('zaken-taak-team-medewerker FOUT'[taak.begindatum]),
NOT(ISBLANK('zaken-taak-team-medewerker FOUT'[taak.begindatum]))
)

 

VAR ZakenIncompleetFout =
CALCULATE(
COUNTROWS('zaken-taak-team-medewerker FOUT'),
'zaken-taak-team-medewerker FOUT'[Taak afgerond] = "nee",
'zaken-taak-team-medewerker FOUT'[Vandaag is na streefeinddatum taak] = "ja",
'zaken-taak-team-medewerker FOUT'[Zaak actief] = "ja",
DATESINPERIOD(
dimDate[Date],
EersteDatumFout,
1,
MONTH
)
)

 

VAR TotaalIncompletezakenFout =
CALCULATE(
COUNTROWS('zaken-taak-team-medewerker FOUT'),
DATESINPERIOD(
dimDate[Date],
EersteDatumFout,
1,
MONTH
)
)

 

RETURN
DIVIDE(ZakenIncompleetCorrect, TotaalIncompletezakenCorrect, 0) +
DIVIDE(ZakenIncompleetFout, TotaalIncompletezakenFout, 0)

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous 

 

I read the code you provided carefully, and i think the DATESINPERIOD() should work well.

I speculate that there are something else affect the outcome.

Please check if there are some data being filtered, if possible, please share your data(exclude sensitive data), or create some sample data, so that we can help you better.

 

You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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