Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Discrepancy In Totals

Hi

I am facing a weird problem

 

Consider the highlighted value as total of 1-way gain monthly.

From two different scenarios:

1. Without YEAR filtered

2. With year 2019 Filtered:

 

Measures in question:

 

 

 

1-Way gain Monthly = 
VAR lastMonth1WayDistribution = CALCULATE([1-Way Distribution],DATEADD(dDate[Date],-1,MONTH))
Return
CALCULATE([1-Way Distribution]-lastMonth1WayDistribution)
1-Way Distribution = 
VAR TotalLoadCategory = CALCULATE(SUM('Prototype Modeling_Freight'[# Shipments]))
VAR OneWay = CALCULATE(SUM('Prototype Modeling_Freight'[# Shipments]),'Prototype Modeling_Freight'[Load Category]="1-Way")
Return
DIVIDE(OneWay,CALCULATE(TotalLoadCategory,ALLSELECTED()),BLANK())

 

 

 

 
Can you explain me why total is not "0" for 2019 filtered?

 

PS:

 

  • Anonymous read this post you will get the answer, filter context is not passed to variables within your dax expression.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

     

     

2 Replies

  • Anonymous read this post you will get the answer, filter context is not passed to variables within your dax expression.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!