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,
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!
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 |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |