Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
73 | |
72 | |
39 | |
25 | |
23 |
User | Count |
---|---|
96 | |
93 | |
50 | |
43 | |
42 |