Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Solved! Go to Solution.
@waleed111 , Because selectcolumns return table. And when you create a new column it expects a new column value only one unique value. So new table it works and New columns it gives an error
https://docs.microsoft.com/en-us/dax/selectcolumns-function-dax
https://www.youtube.com/watch?v=TtkdZ2jbffA
New table is working because it expects a table
table = SELECTCOLUMNS('List View', "inventory", 'List View'[Date-Time of Entry in Inventory])
This function can now return a new column
Column = maxx(SELECTCOLUMNS('List View', "inventory", 'List View'[Date-Time of Entry in Inventory]),[Date-Time of Entry in Inventory])
@waleed111 - There are three primary kinds of things that you can create in Power BI
Columns and Measures formulas need to return single value (a scalar) while tables formulas need to return a table of values. When you are having problems with DAX formulas like this, it is always good to check the documentation:
https://docs.microsoft.com/en-us/dax/selectcolumns-function-dax
Here you can see:
A table with the same number of rows as the table specified as the first argument. The returned table has one column for each pair of <name>, <scalar_expression> arguments, and each expression is evaluated in the context of a row from the specified <table> argument.
Therefore, for the column formula, you will need to aggregate the table or perform some calculation that returns a scalar value, like wrapping that statement with a COUNTROWS function or one of the X iterators like SUMX, AVERAGEX, etc.
@waleed111 , Because selectcolumns return table. And when you create a new column it expects a new column value only one unique value. So new table it works and New columns it gives an error
https://docs.microsoft.com/en-us/dax/selectcolumns-function-dax
https://www.youtube.com/watch?v=TtkdZ2jbffA
New table is working because it expects a table
table = SELECTCOLUMNS('List View', "inventory", 'List View'[Date-Time of Entry in Inventory])
This function can now return a new column
Column = maxx(SELECTCOLUMNS('List View', "inventory", 'List View'[Date-Time of Entry in Inventory]),[Date-Time of Entry in Inventory])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
82 | |
57 | |
41 | |
39 |
User | Count |
---|---|
116 | |
82 | |
78 | |
48 | |
42 |