JAVED's avatar
JAVED
Icon for Helper I rankHelper I
7 years ago
Status:
Done

measure to calculate multiple columns

Hi ,

I have 4 columns with A,B,C,D and i have filters with A,B,C,D Have to create a column or measure with sum(A),count(B),Count(C),Count(D) the output have to display only that value when i click on filters For example if i select A it should display only A value and if  i selecton B  it should display only B values.

 

Thanks,

Javed

4 Comments

  • Anonymous's avatar
    Anonymous
    Not applicable

    JAVED,

    I make a test in the following sample table.


    Firstly, create a new table as below.


    Secondly, create the following measures in the Table1.

    SUMA = SUM(Table1[A])
    COUNTB = COUNT(Table1[B])
    COUNTC = COUNT(Table1[C])
    COUNTD = COUNT(Table1[D])
    Measure = IF(SELECTEDVALUE(Table2[Column1],"")="A",[SUMA],IF(SELECTEDVALUE(Table2[Column1],"")="B",[COUNTB],IF(SELECTEDVALUE(Table2[Column1],"")="C",[COUNTC],[COUNTD])))


    After the above steps, you can create slicer as below.

    If you don't get expected result using above steps, please share sample data of your table here and share desired result based on the sample data.

    Regards,
    Lydia

  • Thanks for the reply Anonymous

    But if i don't select anything it should display all but by this it is not showing

  • Anonymous's avatar
    Anonymous
    Not applicable

    JAVED,

    What do you mean that " display all when you don't select anything"? Could you please share sample data of your tables and post expected result here?

    Regards,
    Lydia