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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dcg38524
Helper III
Helper III

Error Multiple columns cannot be converted to a scalar value

 

 

 

Hello,

 

I am attempting to gather a total occurance of an amount of tickets using a distinct values in a column which works great. 

 

But when I add filtering on which Year to sort my results on fails evertime with error "Multiple columns cannot be converted to a scalar value" (see DAX code below).

 

Is there a way to gather the total occurances using a distinct values in a column and then filter a Date or Year?

 

Thank you in advance.

 

CritSitTeamCount = 
            CALCULATE(
                DISTINCTCOUNT( 'CRITSITS'[Ticket ID] )
                    ,RIGHT('CRITSITS'[CritSit Event Type],6) = "Metric"
),

FILTER('CRITSITS', 'CRITSITS'[Year]) = 2020 )

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@dcg38524 

Try like

 

CritSitTeamCount = 
            CALCULATE(
                DISTINCTCOUNT( 'CRITSITS'[Ticket ID] )
                    ,RIGHT('CRITSITS'[CritSit Event Type],6) = "Metric",
					FILTER('CRITSITS', 'CRITSITS'[Year] = 2020 )
)
OR
 CritSitTeamCount = 
            CALCULATE(
                DISTINCTCOUNT( 'CRITSITS'[Ticket ID] )
                    ,RIGHT('CRITSITS'[CritSit Event Type],6) = "Metric",
					 'CRITSITS'[Year] = 2020 
)

 if you need more help make me @

Appreciate your Kudos.

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@dcg38524 

Try like

 

CritSitTeamCount = 
            CALCULATE(
                DISTINCTCOUNT( 'CRITSITS'[Ticket ID] )
                    ,RIGHT('CRITSITS'[CritSit Event Type],6) = "Metric",
					FILTER('CRITSITS', 'CRITSITS'[Year] = 2020 )
)
OR
 CritSitTeamCount = 
            CALCULATE(
                DISTINCTCOUNT( 'CRITSITS'[Ticket ID] )
                    ,RIGHT('CRITSITS'[CritSit Event Type],6) = "Metric",
					 'CRITSITS'[Year] = 2020 
)

 if you need more help make me @

Appreciate your Kudos.

 

Thank you very much, your solutions worked great as expected.

 

Best regards,

Don

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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