Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey guys, is there a way to perform this sort of operation?:
New Table =
VAR crossjoinedAB = CROSSJOIN('tableA', 'tableB'
VAR crossjoinedABwithNewCol = AddColumn(crossjoinedAB, "FilterByThisColumn", IF( [ColumnInA] = 1, 1, 0))
RETURN CALCULATETABLE(crossjoinedABwithNewCol, [FilterByThisColumn] = 1)
As of right now I cannot get away with adding a new column, and then filtering by it in the same expression. I can get around this by splitting this into two parts, where part 1 makes the table with the new column
New Table =
VAR crossjoinedAB = CROSSJOIN('tableA', 'tableB'
VAR crossjoinedABwithNewCol = AddColumn(crossjoinedAB, "FilterByThisColumn", IF( [ColumnInA] = 1, 1, 0))
and part 2, is when I make ANOTHER new table to filter it.
New Table2 =
RETURN CALCULATETABLE('New Table', [FilterByThisColumn] = 1)
Is there a way to do this in a single step, without having to create an intermediary table?
Solved! Go to Solution.
Hi @zwaters3 ,
try this
New Table =
VAR crossjoinedAB = CROSSJOIN('tableA', 'tableB')
VAR crossjoinedABwithNewCol = ADDCOLUMNS(crossjoinedAB, "FilterByThisColumn", IF( [ColumnInA] = 1, 1, 0))
RETURN FILTER(crossjoinedABwithNewCol, [FilterByThisColumn] = 1)
I already have this transformation up and running through power query, I'm just trying to recreate it for testing which loads faster.
Hi @zwaters3 ,
try this
New Table =
VAR crossjoinedAB = CROSSJOIN('tableA', 'tableB')
VAR crossjoinedABwithNewCol = ADDCOLUMNS(crossjoinedAB, "FilterByThisColumn", IF( [ColumnInA] = 1, 1, 0))
RETURN FILTER(crossjoinedABwithNewCol, [FilterByThisColumn] = 1)
Hi @zwaters3 ,
from experience I would say Power Query.
Power Query has the advantage that with query folding, the data may already be filtered in the source and that the result is saved with a higher compression.
I understand that may be true, but I would still prefer to have an answer to my original question.
sorry, you provided the answer just as I responded to your previous post
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |