cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
discrate
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.
 

YearlyTotalCalculate.png

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
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!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
Super User IV
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!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

discrate
New Member

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

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

Super User IV
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!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

discrate
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

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.