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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
srineshnisala
Frequent Visitor

COUNTROWS A table of multiple values was supplied

I want to get the row count of a table after filtering some rows based on Customership Slice and Date Range Slice. Here StartDate & EndDate comes from Date Range Slice and SCustomership from Customership Dropdown Slice. What am I doing wrong here?

 

Summary Customer = 

VAR StartDate = FIRSTDATE(Calender[Date])
VAR EndDate = LASTDATE(Calender[Date])
VAR SCustomership = SELECTEDVALUE(Customership[Type])

RETURN
    CALCULATE(
        COUNTROWS(CustomersPlan),
        FILTER(
            CustomersPlan,
            OR(
                AND(
                    SCustomership = "Active",
                    AND(
                        CustomersPlan[startdate] < EndDate,
                        OR(ISBLANK(CustomersPlan[enddate]), CustomersPlan[enddate] >= EndDate)
                    )
                ),
                AND(
                    SCustomership = "Everything",
                    DATESBETWEEN(CustomersPlan[startdate], StartDate, EndDate) ||
                    DATESBETWEEN(CustomersPlan[enddate], StartDate, EndDate) ||
                    AND(
                        CustomersPlan[startdate] < StartDate,
                        (ISBLANK(CustomersPlan[enddate]) || CustomersPlan[enddate] > EndDate)
                    )
                )
            )
        )
    )

 

I get following error when I added this measure to a label.

 

Error Message:
MdxScript(Model) (28, 21) Calculation error in measure 'CustomersPlan'[Summary Customer]: A table of multiple values was supplied where a single value was expected.
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@srineshnisala ,datesbetween return a series of dates

 

AND(
SCustomership = "Everything",
(CustomersPlan[startdate]>= StartDate && CustomersPlan[startdate]<= EndDate) ||
(CustomersPlan[enddate]>= StartDate && CustomersPlan[enddate]<= EndDate) ||
AND(
CustomersPlan[startdate] < StartDate,
(ISBLANK(CustomersPlan[enddate]) || CustomersPlan[enddate] > EndDate)
)
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@srineshnisala ,datesbetween return a series of dates

 

AND(
SCustomership = "Everything",
(CustomersPlan[startdate]>= StartDate && CustomersPlan[startdate]<= EndDate) ||
(CustomersPlan[enddate]>= StartDate && CustomersPlan[enddate]<= EndDate) ||
AND(
CustomersPlan[startdate] < StartDate,
(ISBLANK(CustomersPlan[enddate]) || CustomersPlan[enddate] > EndDate)
)
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks It worked

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors