The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 ReportingTry changing the column types both to text (instead of whole number for what i assume city key is). Even if it is set not to sum, the field is being looked at as numerical and trying to sum it when bringing in data.
The 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 Reporting