Please Help !!! I have created a P&L in power BI. the problem is when i try to use the key value measure in a new matrix it returns an error. If i copy the visual it still works but not in a new one ??? the measure and the error it returns is below:

John Harrison 21 Reputation points
2022-04-15T15:08:39.093+00:00

ERROR is : "A table of multiple values was supplied when a single value was expected"

I have the below in two separate matrix on the same dashboard. The new one returns the above error, and the original visual works perfect, filtering and all !!

I think the error refers to the " VALUES(ReportLayout[Line]) ="Total Revenue",Revenue "

The ReportLayout is the P&L format table.

Everything was working fine until i tried to Use the measure in a new matrix. Both matrix are set up exactly the same (filters etc). One works perfect the other nothing but the error. So frustrating!!!

PL Totals '000 =
VAR Revenue = CALCULATE(SUM(CONSOL[NetAbs]),ALLSELECTED(ReportLayout),ReportLayout[Section]="Revenue")
VAR OpCost = CALCULATE(SUM(CONSOL[NetAbs]),ALLSELECTED(ReportLayout),ReportLayout[Section]="Operating Cost")
VAR OpProfit = Revenue-OpCost
VAR OHead = CALCULATE(SUM(CONSOL[NetAbs]),ALLSELECTED(ReportLayout),ReportLayout[Section]="Overhead")
VAR Profit = OpProfit-OHead
VAR LineSum = SUM(CONSOL[NetAbs])+0

RETURN
IF(
VALUES(ReportLayout[Line])="Total Revenue",Revenue,
IF(
VALUES(ReportLayout[Line])="Total Operating Cost",OpCost,
IF(
VALUES(ReportLayout[Line])="Total Operating Profit",OpProfit,
IF(
VALUES(ReportLayout[Line])="Total Overhead",OHead,
IF(
VALUES(ReportLayout[Line])="Total Profit",Profit,
IF(
LEFT(VALUES(ReportLayout[Section]),5)="blank",BLANK(),
LineSum))))))

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,794 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful