Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |