Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi experts,
I have been using another table (tableB) to sum specific values in tableA using the following simple DAX:
Sum amount = CALCULATE ( SUM ( tableA[Amount] ), tableB[NewProducts] )
However this works only when Product_code in both tables is numeric. When Product_code is text, I get this error message: Cannot convert value "300a" of type Text to type True/False". How do I go around this?
My sample tables are like this:
tableA tableB Product_code Amount Product_code 123a 100 125a 125a 120 300a 200 130 300a 90
Solved! Go to Solution.
OK, looks like this measure solves the issue:
Sum amount = CALCULATE ( SUM ( tableA[Amount] ), DISTINCT ( tableB[NewProducts]) )
OK, looks like this measure solves the issue:
Sum amount = CALCULATE ( SUM ( tableA[Amount] ), DISTINCT ( tableB[NewProducts]) )
Try
Sum Amount =
CALCULATE (
SUM ( tableA[Amount] ),
FILTER ( TableA, TableA[Product_code] = TableB[NewProducts] )
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 193 | |
| 124 | |
| 101 | |
| 67 | |
| 49 |