Forum Discussion

timoneill84's avatar
timoneill84
Frequent Visitor
8 years ago
Solved

Monthly Percentage

Hi all

 

I'm new to Power and have only done three of the tutorials so I apologise if the question has a simple answer!

 

How would I go about showing the total number of records / rows that read as certain text as a percentage of the total records that read the same text in another linked table? Pretty sure I need to do a calculated measure using Dax....

 

So for example the total "4x4 car" records in one table as a percentage of the total "4x4 car" records in another table?

 

Thanks

 

Tim

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    timoneill84,

    Create a measure using DAX below and check if you get expected result.

    Measure 2 = CALCULATE(COUNTA(Table1[ColumnName]),FILTER(Table1,Table1[ColumnName]="4x4 car"))/CALCULATE(COUNTA(Table2[ColumnName]),FILTER(Table2,Table2[ColumnName]="4x4 car"))


    If the above DAX doesn't help, please share dummy data of the two tables and post expected result based on the dummy data.

    Regards,
    Lydia

     

    • timoneill84's avatar
      timoneill84
      Frequent Visitor

      Thanks Lydia

       

      I'm getting the "Too many arguments were passed to the COUNTA function. The maximum argument count for the function is 1."

       

      So one table would be like this for example:-

       

      12345678      001234566     2      001234566 2       5 Door Hatchback

      12345679      001234567     4      001234567 4       5 Door 4x4

      12345673      001234569     7      001234569 7       3 Door 4x4

       

      second table:-

       

      5 Door Hatchback   10

      5 Door 4x4              1

      3 Door 4x4              1

       

      The formula would basically need to sum the figures of rows which contain the text "4x4" (which is 2) from table two and divide by the count of the same text criteria for table one (so also 2) and then x100 making the answer here 100%.

       

      I've realised there is no link / common field between the tables, does this matter?

       

      Thanks