Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
alfonsoasenjo
Frequent Visitor

Classify if the ticket have passed through the error range (Start of the issue, End of the issue)

Hello everyone

 

I'm wondering if somebody can give me light to my issue how to do or if its even possible to query. Basically I have two tables, "rank failure" where are all the periods of times that the principal system had problems in the connection (Start of the issue, End of the issue) 

 

and the principal table "Principal" where i have all the tickets that have been made, with there respective (Created date and Resolution Date). 

 

The thing i would like to do is add a column on principal, column that classify if the ticket have passed through the error range. ex. "OK", "FAILURE", or made a new table with all the tickets that have passed through the error range.

I try using If formula

 
 
 
State = IF(principal[created]<rank failure[Inicio]&&rank failure[Inicio]<principal[resolution]||principal[created]>rank failure[Inicio] && principal[created]<rank failure[Fin],"Failure","OK")
 
But it mark it as syntax error, I have already match the column created with the column inicio* Im not really sure if Im doing ok
 

Any help is really appreciated. Thanks a lot

Maria J.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@alfonsoasenjo , Create a new column in principal like

 

if(countx( filter('rank failure', principal[created]< 'rank failure'[Inicio]
&& 'rank failure'[Inicio]<principal[resolution]
||principal[created]>'rank failure'[Inicio]
&& principal[created]<rank failure[Fin]),'rank failure'[Inicio] )+0 >0,"Failure","OK")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@alfonsoasenjo , visual in not clear, but seem like one part of if is date and another one 0. they are two different data type.

Make 0 as blank()

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

yes i used this: 

Fecha de Resolución = IF(ISBLANK(principal[resolutiondate].[Date]),0,principal[resolutiondate]),
and then replace: 
if(countx( filter('rank failure', principal[created]< 'rank failure'[Inicio]
&& 'rank failure'[Inicio]<principal[Fecha de Resolución]
||principal[created]>'rank failure'[Inicio]
&& principal[created]<rank failure[Fin]),'rank failure'[Inicio] )+0 >0,"Failure","OK")
 
Thank you very much for all your help,
Its solved 🙂
amitchandak
Super User
Super User

@alfonsoasenjo ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I could solve it somehow, by replacing the column of "principal[resolution]", there where blank data of the tickets that have not been resolved yet. i replace the blank data with 0. I dont know if you have a better solution for it. Thanks you for the help

alfonsoasenjo_0-1606492362556.png

just replace the principal[resolution] with principal[Fecha de Resolución]

 

amitchandak
Super User
Super User

@alfonsoasenjo , Are Inicio and fin have datatype date or text. Make sure all dates have datatype date

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

yes, all the columns have datetype format

alfonsoasenjo_1-1606486046838.png

 

 

amitchandak
Super User
Super User

@alfonsoasenjo , Create a new column in principal like

 

if(countx( filter('rank failure', principal[created]< 'rank failure'[Inicio]
&& 'rank failure'[Inicio]<principal[resolution]
||principal[created]>'rank failure'[Inicio]
&& principal[created]<rank failure[Fin]),'rank failure'[Inicio] )+0 >0,"Failure","OK")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello! thank you for the prompt reply,

 

I used the formula that you suggest, but I still have the syntax error. "DAX comparison operations do not support comparison values of type Date with values ​​of type Text. Consider using the VALUE or FORMAT function to convert one of the values". Just to clarify all dates in both tables are in DATE/HOUR format.

 

Thanks you for the help, I feel Ill get it soon

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors