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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Calculation error SUMX in table

Hello all,

 

 

I want to create a measure to calculate the Current Ticket  based on the following code:

 

Current Ticket = var currentDate = MAX(OWK_CI_INCIDENTS[IDT_STARTDATUM].[Date]) return SUMX(FILTER(ALL(OWK_CI_INCIDENTS);MONTH(OWK_CI_INCIDENTS[IDT_STARTDATUM].[Date])=MONTH(currentDate)&&YEAR(OWK_CI_INCIDENTS[IDT_STARTDATUM].[Date])=YEAR(currentDate));[REMEDYTICKET_NUMBER])

 

Unfortunat;y i have the following error message :

 

 

2017-02-09 11_41_49-Orakel_performance_v1 - Power BI Desktop.png

 

 

The data type for OWK_CI_INCIDENTS[IDT_STARTDATUM].[Date])  is Date   and for REMEDYTICKET_NUMBER is Text.

 

 

2017-02-09 11_45_09-Orakel_performance_v1 - Query Editor.png

 

 

Thanks for your help!

 

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

The error message display clearly that SUM evaluates to numbers or dates, but it can't work with type string. In your resouce table, the data type for REMEDYTICKET_NUMBER is Text, so it return the error. 

I create sample table similar like yours, but the datatype is number, it works fine.

1.PNG

Best regards,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

The error message display clearly that SUM evaluates to numbers or dates, but it can't work with type string. In your resouce table, the data type for REMEDYTICKET_NUMBER is Text, so it return the error. 

I create sample table similar like yours, but the datatype is number, it works fine.

1.PNG

Best regards,
Angelia

Anonymous
Not applicable

hI @v-huizhn-msft,

 

Thank you for testing. the REMEDY_TICKET was created as a Text. For example INC0000012345.

I had to split this column via Delimiter and removed the 'INC'.

 

Also i changed the SUMX into COUNTX , because i want to count how many remedy tickets have been created in the current year.

 

have a nice day.

 

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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