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.
Hi Guys
Can you use a list created in power query within a Dax variable
Example: In power query(M) convert a table to a list. Then reference that list as string variable in Dax
Kind regards
Devon
Any legit data type in PQ (list, record, number, text ...) is automatically converted to table when loaded into data model used by DAX.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Can you provide sample data and a depiction of what you are trying to do? There are table functions which can be used in variables, measures and to create new tables.
Proud to be a Super User!
Paul on Linkedin.
I am trying to accomplish something like the below:
Where that table variable would be a table of "select columns"
Hi @dvn_charles ,
I agree with CNENFRNL , your list will be convert to table automatically in Report View.
Here I convert Table2 to a List.
List has been converted to a table automatically in Report View.
So you can use it to calculate in your calculation. I have checked your code, and I think it won't be a measure. It should be a calculated table.
There should be two tables in UNION function, so your code will return an error.
It should look like as below.
Test Measure Output =
VAR TableVar =
SUMMARIZECOLUMNS ( 'Measure List'[--Dax_Statement] )
RETURN
CALCULATETABLE(
UNION(
Table1,
TableVar
))
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It would be a much more useful help comment if you would show examples of referencing items in the list/table using an Index with DAX syntax and include the output.
Are there data structures available in Dax?
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 |
---|---|
100 | |
100 | |
80 | |
77 | |
66 |
User | Count |
---|---|
134 | |
106 | |
104 | |
85 | |
73 |