Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
Below is my sample data.
name | amount | date |
a | 100 | 1/1/2018 |
a | 200 | 2/1/2018 |
a | 300 | 3/1/2018 |
b | 350 | 1/1/2018 |
b | 400 | 2/1/2018 |
b | 500 | 3/1/2018 |
b | 600 | 4/1/2018 |
c | 700 | 1/1/2018 |
c | 800 | 2/1/2018 |
c | 900 | 3/1/2018 |
c | 1000 | 4/1/2018 |
Here is our requests. We want to calculate MOM by customer. If the month or date filter selected all or nothing. The MOM = Latest month - last month.
Below are the codings I used.
LATEST AMOUNT = VAR MAXDATE= MAX('fact1'[date]) return CALCULATE(SUM(fact1[amount]),FILTER(fact1,'fact1'[date]=MAXDATE))
LATEST AMOUNT = VAR MAXDATE= MAX('fact1'[date]) return CALCULATE(SUM(fact1[amount]),FILTER(fact1,'fact1'[date]=MAXDATE))
MOM = [LATEST AMOUNT]-[PM AMOUNT]
Proud to be a Super User!
Solved! Go to Solution.
Proud to be a Super User!
Proud to be a Super User!
Hi @ryan_mayu
It seems you've solved it, right? If so,please accept the helpful solution to close this thread.
Regards,
Cherie
Could you please take a look at another similar issue? Acutally, my real data is not as simple as what I did in the test.
So I still have other questions about this kind of topic
Thanks in advance.
Proud to be a Super User!
Thanks for your help. I think my issue is abou tthe maxdate select. For b and c , maxdate is 2018/4/1, the maxdate for a is 3/1/2018. Could you please help me on how to change the maxdate for a is also 4/1/2018. Then the value for a is blank() or 0.
Thanks
Ryan
Proud to be a Super User!
User | Count |
---|---|
101 | |
90 | |
79 | |
70 | |
70 |
User | Count |
---|---|
112 | |
96 | |
96 | |
75 | |
72 |