Forum Discussion

ZW's avatar
ZW
Frequent Visitor
4 years ago
Solved

Dynamically Update DAX with Slicer

Hi all, I find this forum a valuable resource and am hoping someone can assist me with the below problem. I have a sample set of personal records, with some data and some n/a.   Name Birthday...
  • amitchandak's avatar
    4 years ago

    ZW , I think this correct as measure.

    Count n/a Percentage =
    DIVIDE (
    COUNTX ( FILTER ( 'Table', 'Table'[Birthday] = "n/a" ), [Birthday] )
    + COUNTX ( FILTER ( 'Table', 'Table'[Nationality] = "n/a" ), [Nationality] )
    + COUNTX ( FILTER ( 'Table', 'Table'[Gender] = "n/a" ), [Gender] )
    + COUNTX ( FILTER ( 'Table', 'Table'[Age] = "n/a" ), [Age] )
    + COUNTX ( FILTER ( 'Table', 'Table'[Occupation] = "n/a" ), [Occupation] )
    + COUNTX ( FILTER ( 'Table', 'Table'[Address] = "n/a" ), [Address] ),
    COUNTROWS ( 'Table' ) * 7
    )

     

    Not as column , as first row do not have any N/a and it 71 %

     

     

    you can have column like

     

    Count n/a Percentage =
    DIVIDE (
    if('Table'[Birthday] = "n/a" ,1,0 )
    +if('Table'[Nationality] = "n/a" ,1,0 )
    +if('Table'[Gender] = "n/a" ,1,0 )
    +if('Table'[Age] = "n/a" ,1,0 )
    +if('Table'[Occupation] = "n/a" ,1,0 )
    +if('Table'[Address] = "n/a" ,1,0 ) ,
    7
    )

     

     

    But my advice is use first one as a measure