Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Card Visualization don't work with Measure as a Filter

Hello community,

 

I am very new to PowerBI. I am trying to display the unique record for the Address field that has more than 1 ID for the Card Visualization (or any big number display) on PowerBI. Here is the sample of data. Eventually, I would like the card visualization display "2". How would I do it? I have tried the table/matrix visualization and it gave me the number that I wanted, because I was able to set the filter by creating a new Measure by filtering out the count=1 scenario. When I copy and paste the visual to Card Visulization, it didn't get me the right number, and I couldn't add the Measure into the filter as it is disabled. I also tried to create a column to sum the count of ID based on the address, but because I also use a year field in the table as a slicer so the sum shouldn't stay the static if using the year slicer. Could anyone give me some idea what I could try?

AddressID
A12300
A12301
B12302
B12303
C12304
D12305
  • You can use a measure like this for your card visual.  Replace Table with your actual table name.

     

    Companies with Multiple IDs =
    COUNTROWS (
        FILTER (
            VALUES ( Table[Company] ),
            CALCULATE (
                DISTINCTCOUNT ( Table[ID] )
            ) > 1
        )
    )

     

    Regards,

    Pat

3 Replies

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    You can use a measure like this for your card visual.  Replace Table with your actual table name.

     

    Companies with Multiple IDs =
    COUNTROWS (
        FILTER (
            VALUES ( Table[Company] ),
            CALCULATE (
                DISTINCTCOUNT ( Table[ID] )
            ) > 1
        )
    )

     

    Regards,

    Pat

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you Pat mahoneypat ! I have got the function works!

  • mahoneypat : I am in a similar situation.

    I have a new table "SourceTable" having 2 values "Ext" and "Int". I have created a slicer with this table.

    Now I have used a card visual and it is displaying values from already created 2 measures.

    After this, I have created a new measure as :

    IsExternalMeasure = if(SELECTEDVALUE(SourceTable[Source])="Ext",1,0)
     
    When I am trying to use above measure as a filter criteria for the card visual, the filter gets disabled.
    Please suggest what is going wrong here?
    NOTE: The important thing is - I want to display the value in the card , which is getting calculated via measure.