Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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:
I want to see the totals. So the following:
| Date | Number of appointments |
| 13-07-2021 | 1430 |
| 14-07-2021 | 1438 |
How can I achieve this?
Solved! Go to Solution.
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
)
)
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.
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
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
)
)
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.
Thank you, this works! When I try to make a line chart, I get this:
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |