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 Fellow Daxers,
I have created a table using SUMMARIZE and ADDCOLUMNS. Now I’m stumped…when I try to compute the MIN() of a column in this Memory table, I get the error:
Table variable 'SummarizeTrendsTable' cannot be used in current context because a base table is expected.
(Incidentally, I have confirmed that the SUMMARIZE and ADDCOLUMNS code works…by looking at the results if I create a “New Table” with the code. Not what I'm doing, mind you, but just to be sure I know it works)
Is it true I can’t use the MIN() function a “Memory Table”?
Thank you in advance! Tom
Here’s the ADDCOLUMNS and SUMMARIZE code with the . It's a small table--about 15 rows each time it's "called".
TestForForum =
(some housekeeping: create LastValue, VariableName, ProviderNo)
VAR SummarizeTrendsTable =
ADDCOLUMNS(
SUMMARIZE( FILTER(Tr_Select,AND(Tr_Select[Variable_Name] = VariableName, Tr_Select[ProvdrNo] = ProviderNo)),
Tr_Select[Measure End Date],
Tr_Select[ProvdrNo],
"MetricValue" , AVERAGE(Tr_Select[Variable_Value])),
"LastValue" , LastValue,
"DataTrend" , DIVIDE((LastValue - [MetricValue])* 100 ,[MetricValue]))
RETURN
MIN(SummarizeTrendsTable[DataTrend])//<---here’s the MIN() function.
Solved! Go to Solution.
@ThomasDay
I am not sure in which context you want to use this table; yet,
MINX should work
MINX ( SummarizeTrendsTable, [DataTrend] )
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I've fixed the second problem by using the filter function with same "pattern" as @Fowmy used in first reply.
CALCULATE(MINX(SummarizeTrendsTab,[DataTrend]),FILTER(SummarizeTrendsTable,[MonthsDuration] > 0))
@ThomasDay
I am not sure in which context you want to use this table; yet,
MINX should work
MINX ( SummarizeTrendsTable, [DataTrend] )
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
But that leads to the next issue: When I use the MINX within a Calculate Statement to filter...per the below, I get the error
"Cannot find table 'SummarizeTrendsTable'"
Does that make sense to you?
CALCULATE(MINX(SummarizeTrendsTab[DataTrend]),SummarizeTrendsTable[MonthsDuration] > 0)
I've fixed the second problem by using the filter function with same "pattern" as @Fowmy used in first reply.
CALCULATE(MINX(SummarizeTrendsTab,[DataTrend]),FILTER(SummarizeTrendsTable,[MonthsDuration] > 0))
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |