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.
Solved! Go to Solution.
Hi @Anonymous ,
Please create an index column in Query Editor and refer to the formulas as below.
tmp =
var a = CALCULATE(MAX('Table'[date]),FILTER('Table','Table'[customer]= EARLIER('Table'[customer])&&'Table'[Index]=EARLIER('Table'[Index])-1))
var lastcall = IF(ISBLANK(a),'Table'[date],a)
var tmp = INT(DATEDIFF('Table'[date],lastcall,DAY)/14)
return
tmp
period =
var period = CALCULATE(SUM('Table'[tmp]),FILTER('Table','Table'[customer] = EARLIER('Table'[customer])&&'Table'[Index] <= EARLIER('Table'[Index])))
return
period
rankx = Rankx(Filter('Table', [customer]=earlier ([customer])&&'Table'[period]=EARLIER('Table'[period])), [date], , desc)
Result would be shown as below.
Pbix as attached.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You can use DATEDIFF() function to defined periods. Please refer to the formulas below and check if the result achieve your expectation.
period = INT(DATEDIFF('Table'[date],CALCULATE(MAX('Table'[date]),FILTER('Table','Table'[customer]= EARLIER('Table'[customer]))),DAY)/14)
rankx = Rankx(Filter('Table', [customer]=earlier ([customer])&&'Table'[period]=EARLIER('Table'[period])), [date], , desc)
Result would be shown as below.
pbix as attached.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks, almost there
I'll try to axplane the problem througt expected outcome
table below (new period for anothe 14 days from previous call
customer date PreviousCALL period rankx
A | 29/10/2019 | 0 | 1 | |
A | 03/11/2019 | 29/10/2019 | 0 | 2 |
A | 26/11/2019 | 03/11/2019 | 1 | 1 |
A | 01/12/2019 | 26/11/2019 | 1 | 2 |
A | 10/12/2019 | 01/12/2019 | 1 | 3 |
A | 25/12/2019 | 10/12/2019 | 2 | 1 |
A | 02/01/2020 | 25/12/2019 | 2 | 2 |
A | 07/01/2020 | 02/01/2020 | 2 | 3 |
Hi @Anonymous ,
Please create an index column in Query Editor and refer to the formulas as below.
tmp =
var a = CALCULATE(MAX('Table'[date]),FILTER('Table','Table'[customer]= EARLIER('Table'[customer])&&'Table'[Index]=EARLIER('Table'[Index])-1))
var lastcall = IF(ISBLANK(a),'Table'[date],a)
var tmp = INT(DATEDIFF('Table'[date],lastcall,DAY)/14)
return
tmp
period =
var period = CALCULATE(SUM('Table'[tmp]),FILTER('Table','Table'[customer] = EARLIER('Table'[customer])&&'Table'[Index] <= EARLIER('Table'[Index])))
return
period
rankx = Rankx(Filter('Table', [customer]=earlier ([customer])&&'Table'[period]=EARLIER('Table'[period])), [date], , desc)
Result would be shown as below.
Pbix as attached.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is not going to be syntactically perfect (especially since I don't know the names of your tables), but should give you enough to work with. This assumes there is a slicer for customers. If call dates need to be within a certain range you can add criteria to the CALCULATETABLE statement to accommodate that. Hope this helps!
RANKX(
CALCULATETABLE(
[Phone Calls],
[Phone Calls].Customer = SELECTEDVALUE(Customer)
),
[Phone Calls].CallDate,
TRUE
)
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 |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |