Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
In my model, I need to calculate customer loyalty. for example, Adam bought a service from us on 15 July 2016, recorded as service effective date and 15 July 2017 as service expiry date, and every year he renewed his service until 1 Jan 2020. I need to come up with a measure to show 3.5 years as Adam's loyalty. Please help me.
Solved! Go to Solution.
Hi @timazarj ,
Try the following formula:
Measure =
CALCULATE(
DATEDIFF(
MIN('Table'[effective date]),
MAX('Table'[expiry date]),
MONTH
) / 12,
ALLEXCEPT('Table','Table'[customer])
)
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,
How is your source data structured? Share data in a format that ca be pasted in an MS Excel file.
Hi @timazarj ,
Try the following formula:
Measure =
CALCULATE(
DATEDIFF(
MIN('Table'[effective date]),
MAX('Table'[expiry date]),
MONTH
) / 12,
ALLEXCEPT('Table','Table'[customer])
)
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! very helpful
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 37 | |
| 28 | |
| 27 |