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 there,
I'm new to power bi and am trying to write a dax query that shows me that customers based in the north region that haven't purchased paper in the last 90 days.
I wrote the code for the measure and it saved ok when I pressed enter. However when I drag the measure out for a visual I'm getting the following error - MdxScript(Model) (4,1) Calculation error in measure 'Orders'[Customers from North without paper last 3 months]: A table of multiple values was supplied where a single value was expected.
How can I fix this error to show me the data I want to see? Or even is there a better dax query I could use to show what I'm looking for?
The code is as follows and screenshot of error also:
Solved! Go to Solution.
The error message is telling you that you're trying to return a tabl, which isn't allowed (even if the table only has one row and column). The docs for the summarize page says that the return value is a table: https://learn.microsoft.com/en-us/dax/summarize-function-dax
DAX measures only allow you to return a single value.
To fix this, you need to aggregate your CustomerIDs table - so something like:
// ... your code here
RETURN
COUNTROWS(CustomerIDs)
might be what you're after.
Thank you very much!
The error message is telling you that you're trying to return a tabl, which isn't allowed (even if the table only has one row and column). The docs for the summarize page says that the return value is a table: https://learn.microsoft.com/en-us/dax/summarize-function-dax
DAX measures only allow you to return a single value.
To fix this, you need to aggregate your CustomerIDs table - so something like:
// ... your code here
RETURN
COUNTROWS(CustomerIDs)
might be what you're after.