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
Anonymous
Not applicable

Total number of measure

I have the following measure that counts the number of appointments in the coming 6 months.

 

 

Rolling 6 month = CALCULATE(COUNT(Afspraken[Datum afspraak]),
DATESINPERIOD(Afspraken[Datum afspraak], TODAY(), 6, MONTH))

 

 

 

This gives the following result when date is added to the table:

Sohan_0-1626183572241.png

 

I want to see the totals. So the following:

DateNumber of appointments
13-07-20211430
14-07-20211438

 

How can I achieve this?

2 ACCEPTED SOLUTIONS
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can try the measure like this:

 

Measure = 
CALCULATE(
    SUMX( ALLSELECTED('Table'[Datum]), [Rolling 6 month] ),
    DATESINPERIOD(
        'Table'[Datum],
        MAX('Table'[Datum]),
        6,
        MONTH
    )
)

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

Hi @Anonymous ,

 

You can try to add an IF condition to these measures, like this:

 

Measure = 
IF(
    MAX('Table'[Datum]) <= TODAY(),
    CALCULATE(
        SUMX( ALLSELECTED('Table'[Datum]), [Rolling 6 month] ),
        DATESINPERIOD(
            'Table'[Datum],
            MAX('Table'[Datum]),
            6,
            MONTH
        )
    )
)

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

View solution in original post

4 REPLIES 4
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can try the measure like this:

 

Measure = 
CALCULATE(
    SUMX( ALLSELECTED('Table'[Datum]), [Rolling 6 month] ),
    DATESINPERIOD(
        'Table'[Datum],
        MAX('Table'[Datum]),
        6,
        MONTH
    )
)

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

Anonymous
Not applicable

Thank you, this works! When I try to make a line chart, I get this:

Sohan_0-1626356852884.png

 

I want to see the values up until today. When I add the date filter, I get different values. Do you know why this happens?

 

Hi @Anonymous ,

 

You can try to add an IF condition to these measures, like this:

 

Measure = 
IF(
    MAX('Table'[Datum]) <= TODAY(),
    CALCULATE(
        SUMX( ALLSELECTED('Table'[Datum]), [Rolling 6 month] ),
        DATESINPERIOD(
            'Table'[Datum],
            MAX('Table'[Datum]),
            6,
            MONTH
        )
    )
)

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

Anonymous
Not applicable

@v-kkf-msft Thank you so much for your help! It's much appreciated!

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.