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

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.

Reply
TobyHowarth
New Member

DAX Integer Type Error

Hi All,

 

I am still fairly fresh in my time with Power BI but I have come across a stranger Error.

I am trying to do a basic measure to count if a column has a certain value. Both values are Whole numbers (right aligned in the query) and the measure says the calculation is ok.

However Power B is throwing up an error regarding varying data types and text. This is strange because as above the values are both whole numbers.

It is probably a rookie error and I have looked through the help but can not seem to find a resolution that fits the issue.


RIDDORS =

CALCULATE(
COUNTA(
search_Incident_StatusFlags[ValueID]),

FILTER(
search_Incident_StatusFlags,
search_Incident_StatusFlags[ValueID]="24")

)

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@TobyHowarth,

Remove double quotes around 24, and use the following DAX to create the measure instead. Double quotes are only required when you set data type of ValueID column to text. 

 

RIDDORS = 
CALCULATE(
COUNTA(
search_Incident_StatusFlags[ValueID]),

FILTER(
search_Incident_StatusFlags,
search_Incident_StatusFlags[ValueID]=24)

)


Regards,

 

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

@TobyHowarth,

Remove double quotes around 24, and use the following DAX to create the measure instead. Double quotes are only required when you set data type of ValueID column to text. 

 

RIDDORS = 
CALCULATE(
COUNTA(
search_Incident_StatusFlags[ValueID]),

FILTER(
search_Incident_StatusFlags,
search_Incident_StatusFlags[ValueID]=24)

)


Regards,

 

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much! so simple when you explained it, I need to go and do some more reading.

 

Thank you again 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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