Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have the following data structure
Name | Row | Format | Value |
A | 0 | X | 10 |
B | 0 | X | 12 |
C | 0 | X | 9 |
D | 0 | X | 11 |
A | 1 | Y | 5 |
B | 1 | Y | 7 |
C | 1 | Y | 6 |
D | 1 | Y | 4 |
I need a calculated column that shows the [Value] (which is a measure) for [Name] A for all instances where [Row] and [Format] are the same so
A | 0 | X | 10 | 10
B | 0 | X | 12 | 10
C | 0 | X | 9 | 10
D | 0 | X | 11 | 10
A | 1 | Y | 5 | 5
B | 1 | Y | 7 | 5
C | 1 | Y | 6 | 5
D | 1 | Y | 4 | 5
I've tried using SUMMARIZE and GROUPBY but I can't get A[Value] to appear against B C & D in the new column.
Ultimately I need to find the percentage difference between the new column and [Value]. I can work that out if I can populate the new column correctly but there may be a better way.
Would appreciate some help please.
Solved! Go to Solution.
Hi @Moco
please try the following calculated column
NewColumn =
VAR CurrentRowFormatTable =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Row], 'Table'[Format] ) )
VAR ATable =
FILTER ( CurrentRowFormatTable, 'Table'[Name] = "A" )
VAR Cost =
SUMX ( ATable, 'Table'[CostA] + 'Table'[CostB] )
RETURN
Cost * 1.03 * 1.04
Hi @Moco
please try the following calculated column
NewColumn =
VAR CurrentRowFormatTable =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Row], 'Table'[Format] ) )
VAR ATable =
FILTER ( CurrentRowFormatTable, 'Table'[Name] = "A" )
VAR Cost =
SUMX ( ATable, 'Table'[CostA] + 'Table'[CostB] )
RETURN
Cost * 1.03 * 1.04
hi @Moco
try to create a calculated table like:
TableA =
SELECTCOLUMNs(
FILTER(
TableName,
TableName[Name]="A"
),
"Row", TableName[Row],
"Format", TableName[Format],
"Value", TableName[Value]
)
then add a calculated column in your original table like:
Column =
LOOKUPVALUE(
TableA[Value],
TableA[Row], TableName[Row],
TableA[Format], TableName[Format]
)
it worked like:
The calculated table has worked but I am getting an error 'A circular dependency was detected...' for the calculated column.
Using different device so can't paste code but this is what has produced the correct table:
baselinecomp =
SELECTCOLUMNS(
FILTER(
TableName,
TableName[Name] = A
),
"Row", TableName [Row],
"Format", TableName [Format],
"Value", CALCULATE((SUM(TableName [CostA])
+SUM(TableName[CostB]))*(1.03)*(1.04)))
I presume the issue is something to do with my final expression!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |