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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Sohan
Helper III
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
v-jayw-msft
Community Support
Community Support

Hi @Sohan ,

 

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

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 

 

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.
amitchandak
Super User
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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.