Forum Discussion

StoryofData's avatar
StoryofData
Helper III
3 years ago

Column counting blank values

Issues with this dax as a column: 

 

Sanctions All (Participant Closed) =
IF('Table'[IemRoleInCase] = "Subject",
COMBINEVALUES ("-", [CaseNumber], [EmplId], [ParticipantName]))


My column appears correctly when in a table format:

 

But when I place it into a card and count distinct, it counts the blank fields

What is the issue with this?

Dax with blank at the end has the same issue

Sanctions All (Participant Closed) =
IF('Table'[IemRoleInCase] = "Subject",
COMBINEVALUES ("-", [CaseNumber], [EmplId], [ParticipantName], BLANK ()))

 

4 Replies

  • Paulo84's avatar
    Paulo84
    Frequent Visitor

    Have you tried using a distinctcount measure to specificially exclude blanks and use it in a card?

    Something like this:

    Distinct Count =

    CALCULATE(
        DISTINCTCOUNTNOBLANK('Your Table'[Sanctions All (Participations All)])
    )


    or

    Distinct Count =

    CALCULATE(
        DISTINCTCOUNT('Your Table'[Sanctions All (Participations All)]),
            FILTER('Your Table',
            NOT(ISBLANK('Your Table'[[Sanctions All (Participations All)]))
        )



  • Hi,

    Here's my suggestion:

    1. Create a calculated column formula as follows
    Combine = Table[CaseNumber]&"-"&Table[EmplId]&"-"&Table[ParticipantName]
    1. Write this measure

    Count = calculate(distinctcount(Table[Combine]),Table[IemRoleInCase]="Subject")

  • Hi,

    Here's my suggestion:

    1. Create a calculated column formula as follows
    Combine = Table[CaseNumber]&"-"&Table[EmplId]&"-"&Table[ParticipantName]
    1. Write this measure

    Count = calculate(distinctcount(Table[Combine]),Table[IemRoleInCase]="Subject")