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 I am trying to get such output
IF [Seconds to Resolved State] = 0 THEN [Time to Open tickets]
ELSEIF [Seconds to Resolved State]>0 and [Seconds to Resolved State]<7200 THEN '<2 hours'
ELSEIF [Seconds to Resolved State]>=7200 and [Seconds to Resolved State]<14400 THEN '2-4 hours'
ELSEIF [Seconds to Resolved State]>=14400 and [Seconds to Resolved State]<28800 THEN '4-8 hours'
ELSEIF [Seconds to Resolved State]>=28800 and [Seconds to Resolved State]<86400 THEN '8-24 hours'
ELSEIF [Seconds to Resolved State]>=86400 THEN '>24 hours' END
I create a sample according to your scenario . [Seconds to Resolved State] and [Time to Open tickets] are all measures . Then create a measure to determine which interval the value of [Seconds to Resolved State] is in .
Measure = SWITCH(TRUE(),[Seconds to Resolved State]=0,[Time to Open tickets],
[Seconds to Resolved State]>0 && [Seconds to Resolved State]<7200,"<2 hours",
[Seconds to Resolved State]>=7200 && [Seconds to Resolved State]<14400,"2-4 hours",
[Seconds to Resolved State]>=14400 && [Seconds to Resolved State]<28800,"4-8 hours",
[Seconds to Resolved State]>=28800 && [Seconds to Resolved State]<86400,"8-24 hours",
[Seconds to Resolved State]>=86400 ,">24 hours")
And the final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I am Sorry, But it didnt worked
Try this measure:
Measure = SWITCH ( TRUE (), [Seconds to Resolved State] = 0,[Time to Open tickets], [Seconds to Resolved State] > 0 && [Seconds to Resolved State] < 7200, "<2 hours", [Seconds to Resolved State] > 7200 && [Seconds to Resolved State] < 14400, "2-4 hours", [Seconds to Resolved State] > 14400 && [Seconds to Resolved State] < 28800, "4-8 hours", [Seconds to Resolved State] > 28800 && [Seconds to Resolved State] < 86400, "4-8 hours", ELSEIF[Seconds to Resolved State] >= 86400, ">24 hours" )
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
do you want to create a DAX column or a conditional column in PQ?
could you pls provide some sample data as well?
Proud to be a Super User!
I am creating measure.
at firts i created a measure to get difference between two dates in seconds.
and now i want to calculate below
IF [Seconds to Resolved State] = 0 THEN [Time to Open tickets]
ELSEIF [Seconds to Resolved State]>0 and [Seconds to Resolved State]<7200 THEN '<2 hours'
ELSEIF [Seconds to Resolved State]>=7200 and [Seconds to Resolved State]<14400 THEN '2-4 hours'
ELSEIF [Seconds to Resolved State]>=14400 and [Seconds to Resolved State]<28800 THEN '4-8 hours'
ELSEIF [Seconds to Resolved State]>=28800 and [Seconds to Resolved State]<86400 THEN '8-24 hours'
ELSEIF [Seconds to Resolved State]>=86400 THEN '>24 hours' END
where [Seconds to Resolved State] and [Time to Open tickets] is my other measure.
maybe you can try this
Measure =
SWITCH (
TRUE (),
[Seconds to Resolved State] = 0,[Time to Open tickets],
[Seconds to Resolved State] > 0
&& [Seconds to Resolved State] < 7200, "<2 hours",
[Seconds to Resolved State] > 7200
&& [Seconds to Resolved State] < 14400, "2-4 hours",
[Seconds to Resolved State] > 14400
&& [Seconds to Resolved State] < 28800, "4-8 hours",
[Seconds to Resolved State] > 28800
&& [Seconds to Resolved State] < 86400, "4-8 hours",
[Seconds to Resolved State] >= 86400, ">24 hours"
)
Proud to be a Super User!
Try this measure:
Measure = A =
SWITCH (
TRUE (),
[Seconds to Resolved State] = 0,[Time to Open tickets],
[Seconds to Resolved State] > 0
&& [Seconds to Resolved State] < 7200, "<2 hours",
[Seconds to Resolved State] > 7200
&& [Seconds to Resolved State] < 14400, "2-4 hours",
[Seconds to Resolved State] > 14400
&& [Seconds to Resolved State] < 28800, "4-8 hours",
[Seconds to Resolved State] > 28800
&& [Seconds to Resolved State] < 86400, "4-8 hours",
ELSEIF[Seconds to Resolved State] >= 86400, ">24 hours"
)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
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 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |