Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all.
I am trying to caculate the variance period on period per customer.
My Period value is in table date
My Customer value is in table customer
My Value is in table Sales
Customer Period Value
A 1 100
A 2 200
A 3 100
B 1 300
B 2 250
B 3 200
This Measure works as expected
Solved! Go to Solution.
Just add "ALL" in the [Value2] measure as below:
Value2 =
VAR periodvalue =
VALUE ( SELECTEDVALUE ( 'Date LookUp'[Financial Period] ) )
RETURN
CALCULATE (
SUM ( 'Sales Invoice History'[STG_Gross_Profit_Less_BDM] ),
FILTER (
ALL ( 'Date LookUp' ),
'Date LookUp'[Financial Period] = periodvalue + 1
)
)
Then it will work well.
Regards,
Lin
Just add "ALL" in the [Value2] measure as below:
Value2 =
VAR periodvalue =
VALUE ( SELECTEDVALUE ( 'Date LookUp'[Financial Period] ) )
RETURN
CALCULATE (
SUM ( 'Sales Invoice History'[STG_Gross_Profit_Less_BDM] ),
FILTER (
ALL ( 'Date LookUp' ),
'Date LookUp'[Financial Period] = periodvalue + 1
)
)
Then it will work well.
Regards,
Lin
Initially this didn't work for me but I then realised it was because I also had a Year field and the All on the filter was bypassing this page filter.
By adding a filter on selected year into the value2 code I got this working perfectly.
Thanks all for your help.
For anyone else experiencing similar problems here is the final code that works for my exmple
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |