Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Genius Community!
Just wondering if anyone could provide some assistance on how to filter each ID by Rating where I can get the difference from initial date to last update month?
e.g
if its ID(A-yes) and rating = red then I would want the count to come back as:
date difference of: 3 month (taking initial as min and last update as max)
ID(A-yes) and rating = amber then I would want the count to come back as:
Data difference of: 1 month
This is a picture in the data and in the last column in bold – my desired result:
My end goal is to create a bar chart with the x axis having months at rating (e.g 1-3 mths, 4-6 months etc) and the y axis having the count per ID. And the legend being the rating so it would be broken down into red and amber columns.
Table is called "Test".
my working script is:
Month_Difference = DATEDIFF(Test[Initial date].[Date], MAX(Test[Last update month].[Date], MONTH))+1
although i need the working script to also filter by rating for red and amber and ID.
i will create x axis having the months at rating by: Months_Rating = SWITCH(Test[Months_Difference], 1, "1-3 months", 2, "1-3 months", 3, "1-3 months")
Thanks for all the help in advance!
Solved! Go to Solution.
Hi @Aj24,
I'd like to suggest you create a calculated column on your fact table to group these records based on the offset of month diff ranges and use it as the axis of the chart.
Diff Group =
VAR offset = 3
VAR diff =
DATEDIFF ( Test[Initial date], Test[Last update month], MONTH )
VAR rate =
INT ( diff / offset )
RETURN
IF (
MOD ( diff, offset ) <> 0,
rate * offset & " ~ " & ( rate + 1 ) * offset,
( rate - 1 ) * offset & " ~ " & rate * offset
)
Regards,
Xiaoxin Sheng
Hi @Aj24,
I'd like to suggest you create a calculated column on your fact table to group these records based on the offset of month diff ranges and use it as the axis of the chart.
Diff Group =
VAR offset = 3
VAR diff =
DATEDIFF ( Test[Initial date], Test[Last update month], MONTH )
VAR rate =
INT ( diff / offset )
RETURN
IF (
MOD ( diff, offset ) <> 0,
rate * offset & " ~ " & ( rate + 1 ) * offset,
( rate - 1 ) * offset & " ~ " & rate * offset
)
Regards,
Xiaoxin Sheng
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |