Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
gbarr12345
Post Prodigy
Post Prodigy

Couldn't load the data for this visual error

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:

 

Customers from north Without Paper Last 3 Months =
VAR Last3Months = CALCULATE(MAX('DateTable'[Date]), DATEADD('DateTable'[Date], -3, MONTH))
VAR CustomerIDs =
    FILTER(
        VALUES('Orders'[Customer Name]),
        CALCULATE(
            COUNTROWS('Orders'),
            'Orders'[Region] = "North" && 'Orders'[Product Sub-Category] <> "Paper",
            'Orders'[Order Date] >= Last3Months
        ) = 0
    )
RETURN
SUMMARIZE(CustomerIDs, 'Orders'[Customer Name])

 

gbarr12345_0-1713215437430.png

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

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.

View solution in original post

2 REPLIES 2
gbarr12345
Post Prodigy
Post Prodigy

Thank you very much!

vicky_
Super User
Super User

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.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors