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.
Hello, so I have 4 tables: ABC, DEF, GHI, and XYZ. All tables have the same column names, but with different values. I wanted to grab the minimum of a column across ABC, DEF, and GHI. So in XYZ, I created the column
min = CALCULATE(MINX(UNION(ABC, DEF, GHI),[columnName]))
That worked great, but now I would like to know where that minimum came from. Is there a way to do an if statement that creates a column minTable to calculate the following process by row:
if min=ABC[columnName]
then minTable = ABC
elseif min=DEF[columnName]
then minTable = DEF
else minTable = GHI
???
I haven't had much luck with this, so even if your suggestion is that I set the original data up in a different way, I'll take any suggestions! Thanks!
HI @GSynchro ,
AFAIK, current if statement not support return table as expression result.(even if you used it in calculated table)
In addition, power bi also not support to create dynamic calculated column/table based on filter.
So I think you can't use if statement or filter to create a dynamic calculated table.
Regards,
Xiaoxin Sheng
Another option I tried that didn't seem to work was adding a column on each table with the table name, then appending tables ABC, GHI, and DEF, then placing [columnName] and [tableName] in a table and having [columnName] to show the minimum. I thought maybe if I sorted [columnName] from smallest to greatest in the table, that First [tableName] would return the one associated with the minimum, but that didn't work either.
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |