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,
I'm a newbie and just learning DAX. I was trying to create a table with SUMMARIZE function but has an error which I think it is weird. I have the column but the function keep telling me it was not found.
This is my code:
Solved! Go to Solution.
@admin_xlsior wrote:Hi Lin,
I was about to send you the pbix, however since it is Direct Query then I tried to change to Import for your convinience. Unexpectedly the error is vanished. Is the error because a limitation of Direct Query ?
Another thing, yes for the USERELATIONSHIP (and CALCULATETABLE) is cleared, thank you very much on your kind explanation.
Thanks,
I don't have the book either, and Phil's syntax is correct, but I don't know the context of his example. If you had the problem with direct query but not import, then yes, that could be the fix. Direct Query doesn't support all Power BI features and should generally be used sparingly. Importing is where Power BI really shines.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThe result I'm looking for is the last vendor purchased from. What is the problem with this formula? It looks like it should work...then I have this error:
Last Supplier Purchased From
=MAXX(
TOPN(1,
SUMMARIZE('DimDate1','DimDate1'[Date],'received pivot'[Vendor Name]),
CALCULATE( MAX('DimDate1'[Date])),ASC),
'received pivot'[Vendor Name])
As to why it thinks your State Province column isn't there, I am not sure. I cannot get this to fail. I tried this in one of my reports and the table created just fine. I am wondering if there is some syntax issue I cannot see in the formula you have shown.
TestTable = SUMMARIZE( Sales, Items[Item Family], Customers[Customer Type], 'Calendar'[Month Name], "New Sales Amount",SUM(Sales[Sales]) )
My data model looks like this which is similar to yours.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi thanks,
For the "USERELATIONSHIP", you're right. there's a flaw on the relationship design, since I tried to recreated it, and it supposed to have another relationship for the other key in my Fact Sale.
The syntax, however, I recreate from the book which I used to learn, "Beginning DAX with PowerBI" By Phillip Seamark, Chapter 4 Page 73. Wondering if you have this book as well ?
This is the exact screenshot of the syntax in that book:
Thanks,
hi, @admin_xlsior
I don't have this book "Beginning DAX with PowerBI", but if you could share your sample pbix file.
For "USERELATIONSHIP", i think there must be more than one relationship are created between "Fact sales" with "Dimension date" based on the example. so for the conditional "USERELATIONSHIP", it needs CALCULATETABLE to evaluates a table expression in a context modified by the given filters.
Best Regards,
Lin
Hi Lin,
I was about to send you the pbix, however since it is Direct Query then I tried to change to Import for your convinience. Unexpectedly the error is vanished. Is the error because a limitation of Direct Query ?
Another thing, yes for the USERELATIONSHIP (and CALCULATETABLE) is cleared, thank you very much on your kind explanation.
Thanks,
@admin_xlsior wrote:Hi Lin,
I was about to send you the pbix, however since it is Direct Query then I tried to change to Import for your convinience. Unexpectedly the error is vanished. Is the error because a limitation of Direct Query ?
Another thing, yes for the USERELATIONSHIP (and CALCULATETABLE) is cleared, thank you very much on your kind explanation.
Thanks,
I don't have the book either, and Phil's syntax is correct, but I don't know the context of his example. If you had the problem with direct query but not import, then yes, that could be the fix. Direct Query doesn't support all Power BI features and should generally be used sparingly. Importing is where Power BI really shines.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering 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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |