Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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 )

 

 

  • Anonymous 

    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.

     

2 Replies

  • Anonymous 

    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.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

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

       

      Best regards,

      Don