Forum Discussion

russm's avatar
russm
Icon for Helper I rankHelper I
10 years ago
Solved

Calculating proportions with DAX

I’m having trouble “thinking in DAX” WRT describing proportions. I have two tables. A table that defines a taxonomy of categories (Dictionary)[Category] and unique issues (Dictionary)[All Issues]....
  • Greg_Deckler's avatar
    Greg_Deckler
    10 years ago

    russm - With the data you posted, I created 2 new columns in Dictionary:

     

    Count of Issues = CALCULATE(COUNTROWS(DISTINCT(Verbatims[UUID])),RELATEDTABLE(Verbatims))
    Percent of Issues = [Count of Issues] / COUNTROWS(DISTINCT(Verbatims[UUID]))

    I get the visualization:

     

    I think I like Sean's better as it shows the total unique (6) and the percentage comes out to 100%. I guess it is just what makes more sense to your users, not all of the issues adding up to 9 or having 150%. Or, just turn off the totals row and don't tell them.

  • Greg_Deckler's avatar
    Greg_Deckler
    10 years ago

    Sean - Assuming that your formulas are for measures, correct?

  • Sean's avatar
    Sean
    10 years ago

    Yes all Measures.