Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Userprinciplename () to filter value only visuals

Hi, 

 

I have some visuals that only contain values from the facts table and I would to filter this by userprinciplename, so people only see their values. I tried to make a measure that countrows  fact table but it is not possible to add the measure to the visual filter.

suggestions?

  • Hi, Anonymous 

    You can create a new measure 'M_value' to replace the field 'Value'.

    M_countrows =
    COUNTROWS ( FILTER ( 'Table', 'Table'[Email] = USERPRINCIPALNAME () ) )
    
    M_Value =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[M_countrows] >0 )
    )
    

     

    Best Regards,
    Community Support Team _ Eason

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

       

      How would countrows measure affect the filtering of the values when it is not possible to put the measure as countrows > 0  in the visual filter 

      • v-easonf-msft's avatar
        v-easonf-msft
        Icon for Community Support rankCommunity Support

        Hi, Anonymous 

        You can create a new measure 'M_value' to replace the field 'Value'.

        M_countrows =
        COUNTROWS ( FILTER ( 'Table', 'Table'[Email] = USERPRINCIPALNAME () ) )
        
        M_Value =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER ( 'Table', 'Table'[M_countrows] >0 )
        )
        

         

        Best Regards,
        Community Support Team _ Eason