Forum Discussion
Translate the dax code to evaluate in Dax studio
- 1 year ago
If you need to add a calculated column showing the prices that pass the filter for each row, please use the following code in dax studio or in the powerbi query view. Please note that nested tables are not accepted in a cell of a powerbi table, therefore the value presented is a concatenation of the values in the field (you may not be able to see all the values included in the concatanation due to string constraints in that cell)
If I responded to your query, please bookmark the post as a solution. Kudos 😀 are acceptedDEFINE COLUMN 'Product'[NewCalculatedColum] = VAR PriceOfCurrentProduct = 'Product'[Unit Price] VAR MoreExpensiveProducts = FILTER ( 'Product', 'Product'[Unit Price] > PriceOfCurrentProduct ) RETURN CONCATENATEX ( MoreExpensiveProducts, 'Product'[Unit Price], UNICHAR ( 10 ), 'Product'[Unit Price], DESC ) EVALUATE Product ORDER BY Product[Unit Price] DESC
Hi , Please try below solution:
EVALUATE
ADDCOLUMNS(
'Product',
"ProductRankDense",
VAR currentrow = 'Product'[Unit Price]
RETURN
COUNTROWS(
FILTER(
VALUES('Product'[Unit Price]),
'Product'[Unit Price] > currentrow
)
) + 1
)
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
Let's Connect on LinkedIn: https://www.linkedin.com/in/anmol-malviya/?originalSubdomain=in
Subscribe my youtube channel for Microsoft Fabric and Power BI updates: https://www.youtube.com/@AnmolPowerBICorner
Thanks for helping, The main part I wanted to translate was the Filter table generated
As highlighted I want to view the table that is been generaed as a result of Filter logic
- anmolmalviya051 year ago
Super User
Please try this:
EVALUATE
ADDCOLUMNS(
VALUES('Product'[Unit Price]),
"FilteredTable",
CALCULATETABLE(
VALUES('Product'[Unit Price]),
'Product'[Unit Price] > 'Product'[Unit Price]
)
)- han_rj1 year ago
Helper IV
Hi, Thank You for trying I did check this solution, the resultant column is empty.
The reason for my query on how to convert the dax expression to dax studio code, is to learn how to turn the row context dax line to dax studio executable code and view how the filter dax table will look