cancel
Showing results for
Did you mean:
Continued Contributor

## Measure based on 2 criteria in two different columns

Hi,

I have  data table name P&L which has "Gross Sales" values  by calendar year. I  created a measure "Gross Sales" to use it in a matrix table column based on values in two columns. Column name in is "P&L"for Gross Sales and "Calendar Year" for 2021 Below is the formula i used to create the measure. However when i try to drag and drop to matrix table it gives me "Cant Display the visual error message". Is this due to an error in the formula or what may have cause this error? I didnt receive any syntax error.

Gross Sales = CALCULATE(SUM('P&L'[Values]),
FILTER ('P&L','P&L'[P&L]= "Gross Sales"),
FILTER ('P&L','P&L'[Calendar Year]= "2021"))

Here is the screenshot of the error.

2 ACCEPTED SOLUTIONS
Continued Contributor

Solved the problem, revised the formula and now it works.

Gross Sales = CALCULATE(('P&L'[2021]), 'P&L'[P&L] in { "Gross Sales"})
Continued Contributor

Solved the problem, revised the formula and now it works.

Correct Formula Gross Sales = CALCULATE(('P&L'[2021]), 'P&L'[P&L] in { "Gross Sales"})
2 REPLIES 2
Continued Contributor

Solved the problem, revised the formula and now it works.

Correct Formula Gross Sales = CALCULATE(('P&L'[2021]), 'P&L'[P&L] in { "Gross Sales"})
Continued Contributor

Solved the problem, revised the formula and now it works.

Gross Sales = CALCULATE(('P&L'[2021]), 'P&L'[P&L] in { "Gross Sales"})

Announcements