cancel
Showing results for
Did you mean:
New Member

## Ratio calculation of month vs full year - need help

Hi,

I have a BI matrix visualization with values in yearly/monthly structure and would like to have a column in which the ratio of each monthly data is being calculated vs the total year.

The only way I was able to calculate the yearly total figure is:

TotalSalesCY = CALCULATE([TotalSales],PARALLELPERIOD(DimDate[Date].[Date],0,YEAR))
Then I could divide the TotalSales by TotalSalesCY.

Is there any other/easier way to override the current monthly filter context (and just have the year filter) when populating data in TotalSalesCY column?
Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV

## Re: Ratio calculation of month vs full year - need help

Not sure it is easier but perhaps:

TotalSalesCY = CALCULATE([TotalSales],ALLEXCEPT(DimDate,DimDate[Year]))

If you have a Year column in DimDate.

---------------------------------------

Putting square pegs in round holes since 1972.

##### I have a NEW book! DAX Cookbook from Packt
Over 120 DAX Recipes!

Proud to be a Datanaut!

4 REPLIES 4
Super User IV

## Re: Ratio calculation of month vs full year - need help

??

---------------------------------------

Putting square pegs in round holes since 1972.

##### I have a NEW book! DAX Cookbook from Packt
Over 120 DAX Recipes!

Proud to be a Datanaut!

New Member

## Re: Ratio calculation of month vs full year - need help

Accidently was posted without body. I have edited the post.

Highlighted
Super User IV

## Re: Ratio calculation of month vs full year - need help

Not sure it is easier but perhaps:

TotalSalesCY = CALCULATE([TotalSales],ALLEXCEPT(DimDate,DimDate[Year]))

If you have a Year column in DimDate.

---------------------------------------

Putting square pegs in round holes since 1972.

##### I have a NEW book! DAX Cookbook from Packt
Over 120 DAX Recipes!

Proud to be a Datanaut!

New Member

## Re: Ratio calculation of month vs full year - need help

Thank you Greg for your quick and helpful reply! This has the same result and formula is exactly what I needed: an other method (ALLEXCEPT) which I can use in other context as well.

Cheers