Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 @Sohan ,
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 @Sohan ,
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 @Sohan ,
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 @Sohan ,
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