Calculating Customer Lifetime in Google Data Studio aka Looker Studio

I have a transactions table and I want to use that to calculate customer life time value using it. I want to apply the below formula 

Customer Lifetime Value = number of months between max date and min date for any customer

How can I achieve that in Looker Studio?