cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nidhi_Kochrekar
Frequent Visitor

If Greater than and less than

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

7 REPLIES 7
Ailsa-msft
Community Support
Community Support

Hi @Nidhi_Kochrekar 

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 :

Ailsamsft_0-1633076105666.png

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.

Nidhi_Kochrekar
Frequent Visitor

I am Sorry, But it didnt worked

Hi @Nidhi_Kochrekar 

 

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!!

@Nidhi_Kochrekar 

do you want to create a DAX column or a conditional column in PQ?

could you pls provide some sample data as well?





Did I answer your question? Mark my post as a solution!

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.

 

@Nidhi_Kochrekar 

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"
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




VahidDM
Community Champion
Community Champion

Hi @Nidhi_Kochrekar 

 

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!!

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors