Forum Discussion
InsightSeeker
10 months agoHelper III
Client Status Measure Based on Selected Date
Hello, I need assistance creating a measure that dynamically calculates client status based on a date selection in my report. I need to classify each client into these status categories: Ex...
- 10 months ago
Hi InsightSeeker
Try below measureStatus = var max_month=MAX('Calendar Ultimate'[Date]) //trading dates for last 13 months var existing_client_dates=DATESINPERIOD('Calendar Ultimate'[Date],max_month,-13,MONTH) //trading dates for last 12 months var nbto_dates=DATESINPERIOD('Calendar Ultimate'[Date],max_month,-12,MONTH) //trading dates for last 6 month var lost_client_dates=DATESINPERIOD('Calendar Ultimate'[Date],TODAY(),-6,MONTH) var res_existing_client=CALCULATE(COUNT(data[Order_Number]),existing_client_dates) var res_newclient=CALCULATE(COUNT(data[Order_Number]),'Calendar Ultimate'[Date]=max_month) var res_nbto=CALCULATE(COUNT(data[Order_Number]),nbto_dates) var res_lost_client=CALCULATE(COUNT(data[Order_Number]),lost_client_dates) RETURN SWITCH( TRUE(), NOT ISBLANK(res_existing_client),"Existing CLient", //more than 12 months NOT ISBLANK(res_nbto),"NBTO", //less than equal to 12 months NOT ISBLANK(res_newclient),"NBTO", //zero month ISBLANK(res_lost_client) || res_lost_client=0,"Lost CLient" //more than 6 month )please give kudos or mark it as resolved once confirmed
Anonymous
10 months agoNot applicable
Thanks for reaching out to the Microsoft fabric community forum.
Could you please let us know if the issue has been resolved? I wanted to check if you had the opportunity to review the information provided by srlabhe and Praful_Potphode . If you still require support, please let us know, we are happy to assist you.
Thank you.