Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Percentage over Monthly Total

Hi

 

I need to calculate the percentage over month for the distinct cound of Customer IDs.

I'm using the following formula, but I am getting the percentage for the whole periods, and not by month

 

What am I doing wrong?

Thanks!

 

PercentageByMonth= 
DISTINCTCOUNT('FactTable'[ID]) /
CALCULATE(
   DISTINCTCOUNT('FactTable'[ID]);
   ALL('Calendar'[Year-Month])
)

 

 

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    I've finally solved. I need to use the Field that is going to be used as a legends, not the fields from the calendar.

    PercentageByMonth= 
    DISTINCTCOUNT('FactTable'[ID]) /
    CALCULATE(
       DISTINCTCOUNT('FactTable'[ID]);
       ALL('Table'[FieldUsedAsLegend])
    )

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I've finally solved. I need to use the Field that is going to be used as a legends, not the fields from the calendar.

    PercentageByMonth= 
    DISTINCTCOUNT('FactTable'[ID]) /
    CALCULATE(
       DISTINCTCOUNT('FactTable'[ID]);
       ALL('Table'[FieldUsedAsLegend])
    )