Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Everyone!!
I am trying to obtain the total Orders for each of our Clients ID but just for the last 6 months. I need this to be a calculed collumn grouping by Client_ID
I have 3 importants tables in this dash:
Table ORDERS, that contains ID column, Client_ID column and Created_at (as a date) column that gives me the date of the order
Table CLIENTS that contains ID column and is linked to the Client_ID column in Table Order
Table CALENDAR that is linked to the Created_at Column
Thank you very much in advance!!!
Solved! Go to Solution.
@Anonymous , Create a measure like this
Rolling 6 = CALCULATE(count(ORDERS[ID]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))
Hi,
Try this
=CALCULATE(count(ORDERS[ID]),datesbetween(Calendar[Date],edate(min(calendar[date]),-5),max(calendar[date])))
Hope this helps.
Hey @Ashish_Mathur
I understand that with this I can filter the number of orders when I put the calendar[date] as a filter in my dash.
But actually I would like to get this result in a calculed column (and the result will change everyday, if someone makes a new order or if this client_id stops making any orders for 6 months he will get 0 orders) and with this calculed column I will create another calculed column clustering all os those clientes according to this parameter - number of orders for the last 6 months
So everyday the clients can change their cluster according to this number
Does it make sense?
Hi,
I am not clear. Share a simple dataset and show your expected result.
@Anonymous , Create a measure like this
Rolling 6 = CALCULATE(count(ORDERS[ID]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))
@amitchandak I tried here and it worked!! I only changed the -6 Month to -60 Day, it seemed better and the result was right!
Thank you very much
Hey @amitchandak
Thank for you reply, can I substitute that MAX(Date[date]) for TODAY()? because I want to get the result in a calculed column, so with that I can analyse groups of clients_ID that has (for example) less than 5 orders for the last 6 months and give then some sort of a cluster
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |