0
votes

I am trying to replicate the below dax calculation which worked in Power BI but throwing error in SSAS tabular model.

Account Warranty Count = CALCULATE(COUNT(dds_repairlogs[Repair Logs]),RELATEDTABLE(dds_repairlogs),filter(dds_repairlogs,dds_repairlogs[Savings Type 2] = "Warranty"))

The error I get is count doesn't work with text fields. However the field Repair Logs in Count function is kind of uniqueidentifier. Does anyone have any suggestions on how to replicate the above measure in SSAS tabular model.

2

2 Answers

0
votes

Adding a little to Olly's answer:

The COUNT function counts rows that contain Numbers, Dates, or Strings - but text values are only counted if they can be translated into a number.

Uniqueidentifier is not a supported data type in SSAS Tabular models, and therefore your uniqueidentifier values are most likely saved as Texts (i.e. Strings).

Changing COUNT(dds_repairlogs[Repair Logs]) to COUNTROWS(dds_repairlogs) in your formula should fix the issue. COUNTROWS counts all rows in a table, rather than numbers in a column.

0
votes

The COUNT function only counts numbers. Your error message indicates the [Repair Logs] field contains non-numeric values.

Try replacing COUNT with COUNTROWS