Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Measure Value

Hi All,

 

I've filtered a column in my report using the below measure:

 

Electric Deals = CALCULATE(COUNT(Deals[TypeName]), FILTER(Deals,Deals[TypeName]= "Electric"))
 

If there a possibility that I get "0" instead of Blank whereever there is no data for Electric Deals?

 

Please see highlited area below: 

 
 
 

Regards,

Himanshu

  • Anonymous , Add +0 to the measure

     

    Electric Deals = CALCULATE(COUNT(Deals[TypeName]), FILTER(Deals,Deals[TypeName]= "Electric")) +0

  • Hi Anonymous 

    adding a zero, as already pointed out, is the most direct solution. Another option is:

    Electric Deals =
    VAR aux_ =
        CALCULATE (
            COUNT ( Deals[TypeName] ),
            FILTER ( Deals, Deals[TypeName] = "Electric" )
        )
    RETURN
        COALESCE ( aux_, 0 )

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

4 Replies

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    adding a zero, as already pointed out, is the most direct solution. Another option is:

    Electric Deals =
    VAR aux_ =
        CALCULATE (
            COUNT ( Deals[TypeName] ),
            FILTER ( Deals, Deals[TypeName] = "Electric" )
        )
    RETURN
        COALESCE ( aux_, 0 )

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

  • aj1973's avatar
    aj1973
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    Use this measure

    IF(ISBLANK(Electric Deals), '0', Electric Deals)

  • Anonymous , Add +0 to the measure

     

    Electric Deals = CALCULATE(COUNT(Deals[TypeName]), FILTER(Deals,Deals[TypeName]= "Electric")) +0

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks !!! it solved my issue.

       

      Regards,

      Himanshu