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!
Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.
Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!
Join the biggest FREE Business Applications Event in LATAM this February.
User | Count |
---|---|
241 | |
51 | |
50 | |
48 | |
45 |
User | Count |
---|---|
289 | |
241 | |
137 | |
83 | |
69 |