Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I got a small question on the warning over a calculation formula. The formula itself seems to work, it gives me the correct output, however, part of the formula is highlighted. When I hoover over the highlighted part, it says "Parameter is not the correct type". What does that mean?
Solved! Go to Solution.
Hi @Jeanxyz
You could refer to RELATED function (DAX) and EARLIER function (DAX). In EARLIER function, the first parameter is expected to be A column or expression that resolves to a column. While the return value of RELATED function is A single value that is related to the current row. Usually a single value is not a column, so it detects the syntax error.
In your case, you could try below code for a calculated column in product table.
total profit per category = CALCULATE(SUM('Product'[Profit]),ALLEXCEPT('Product Category','Product Category'[Category]))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Jeanxyz
You could refer to RELATED function (DAX) and EARLIER function (DAX). In EARLIER function, the first parameter is expected to be A column or expression that resolves to a column. While the return value of RELATED function is A single value that is related to the current row. Usually a single value is not a column, so it detects the syntax error.
In your case, you could try below code for a calculated column in product table.
total profit per category = CALCULATE(SUM('Product'[Profit]),ALLEXCEPT('Product Category','Product Category'[Category]))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
related() is used to get product category from Product Category table, earlier is used to get the product category where the current product belongs to.
Here is the sample file. You can find the formula as a calculated column in product table.
@Jeanxyz , earlier will not take another function.
Why do you need earlier and related together?
First, create a column using earlier in the product table and move it to another using related.
User | Count |
---|---|
127 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |