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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Employee
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
Employee
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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