Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm trying to calculate the average number of invoices vouchered or the past 5 days, however my DAX returns an error
"Calculation error in measure 'vouchered'[Measure]: a table of multiple values was supplied where a single value was expected."
This is my DAX:
Measure = CALCULATE(
AVERAGEX(vouchered, COUNT(vouchered[Invoice Number])),
FILTER(
vouchered,
DATESBETWEEN(
'vouchered'[Created Date].[Date],
DATEADD(LASTDATE(vouchered[Created Date]), -5, DAY),
DATEADD(LASTDATE(vouchered[Created Date]), 1, DAY)
)
)
)What's wrong with my code?
Sample data:
https://docs.google.com/spreadsheets/d/1rc2FTwyysZz8HseGIAf6UWK0uL_k9_l2L9QYgiDD0-I/edit?usp=sharing
DATEADD returns the table not column and that could be the reason.
https://msdn.microsoft.com/en-us/library/ee634905.aspx
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I changed it, but I'm still getting an error. Here's my latest function:
Measure = CALCULATE(
AVERAGEX(vouchered, COUNT(vouchered[Invoice Number])),
FILTER(
ALLEXCEPT(vouchered, vouchered[Created Date].[Date]),
DATESBETWEEN(
'vouchered'[Created Date].[Date],
LASTDATE(vouchered[Created Date].[Date])-5,
LASTDATE(vouchered[Created Date].[Date])
)
)
)
hey @Anonymous
try using quick measures to get your past 5 days average.
kind regards;
HiltonM
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |