Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi Experts,
please help me to acheive the below:
I tried hard but nothing is working.
I want to subtract the value = Dec-Jan = -16.28
Please help me on this.
Regards.,
Swamy
Solved! Go to Solution.
Hi @Swamy3105 ,
Below is my table:
You can create a index column:
The following DAX might work for you:
output =
var _a = CALCULATE(max('table'[value]),filter('table','table'[index]=earlier('table'[index])+1))
RETURN
'Table'[Value] - _a
The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You could be use measure instead of calculated column. I believe measure is best option to summarize the expression and also good to performance. you will use below expression as seen in the snapshot.
Hi @Swamy3105 ,
Thank you for @Syndicate_Admin answer , and I have other suggestions:
Below is my table:
The following DAX might work for you:
Column =
VAR _month = MIN('Table'[Year])
VAR _new_month = MONTH(EDATE(_month,1))
VAR _a = CALCULATE(MAX('Table'[FIFO]),FILTER('Table',MONTH('Table'[Year]) = _new_month))
VAR _b = CALCULATE(MAX('Table'[FIFO]),FILTER('Table',MONTH('Table'[Year]) = MONTH(_month)))
RETURN
_b - _a
The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thanks for your dax, but I need to subtract the value from current month to previous month as below:
Regards.,
Swamy
Hi @Swamy3105 ,
Below is my table:
You can create a index column:
The following DAX might work for you:
output =
var _a = CALCULATE(max('table'[value]),filter('table','table'[index]=earlier('table'[index])+1))
RETURN
'Table'[Value] - _a
The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Nice
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
119 | |
78 | |
58 | |
52 | |
46 |
User | Count |
---|---|
170 | |
117 | |
63 | |
58 | |
51 |