Reputation: 1
In power BI I want to calculate measure based on some filters, Firm number which contains numeric as well as alphanumeric values, and this one is selected by the user in paginated report. I am applying simple filter but gives me error "Cannot convert value 'a1234' of type text to type True/False." My code to calculate measure is
AdminCost = CALCULATE(SUM('LoadCostStmtPayees'[COST]),
'Employer Dimensions'[FirmNumber],
FILTER('LoadCostStmtPayees',LoadCostStmtPayees[FUNDTYPE]="Administration Fund")
)
Please help me How I can apply filter with the alphanumeric values in a filter.
Upvotes: 0
Views: 30
Reputation: 12171
This is the issue 'Employer Dimensions'[FirmNumber]
in your expression. It is missing the conditional part, without it DAX is assuming a boolean value. Since this is report filter/slicer, you don't need to include it in your calculation.
Try the following:
AdminCost =
CALCULATE(
SUM('LoadCostStmtPayees'[COST]),
LoadCostStmtPayees[FUNDTYPE] = "Administration Fund"
)
(Note: You don't need to use FILTER
and the above is shorthand for the same.)
Upvotes: 0