cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper III

## SUM of number of dates

I have the following measure that counts the number of appointments on any given day in the coming 6 months.

``````SUM of 6 months appointments =
IF(
MAX(Datum[Date]) <= TODAY(),
CALCULATE(
SUMX( ALLSELECTED(Datum[Date]), [Rolling 6 month] ),
DATESINPERIOD(
Afspraken[Datum afspraak],
MAX(Afspraken[Datum afspraak]),
6,
MONTH
)
)
)``````

``````Rolling 6 month = CALCULATE(COUNTROWS(Afspraken), DATESINPERIOD(Afspraken[Datum afspraak], TODAY(), 6, MONTH),
FILTER(Afspraken, Afspraken[Status] = "Planned"),
FILTER(Afspraken, Afspraken[Soort afspraak] <> "Phone call"))<p> ``````

The values I get aren't correct though, is the line stays flar for far too long. When I'm manually checking the values, they are incorrect. Does anyone know why this might be?

3 REPLIES 3
Community Support

Hi @Sohan ,

It's better to share some sample data and expected result so that we could help you with the formula.

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Super User

@Sohan , Try like

``````Rolling 6 month = CALCULATE(COUNTROWS(Afspraken), DATESINPERIOD(Afspraken[Datum afspraak], TODAY(), 6, MONTH),
FILTER(Afspraken, Afspraken[Status] = "Planned" &&  Afspraken[Soort afspraak] <> "Phone call"))``````

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helper III

@amitchandak Thanks for your reply! Unfortunately, nothing changes when I edit the code like you suggested.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors