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,
Currently I'm having request based on by choosing current year-month , I would like to see the result based on (currentmonth - previousmonth) as a result. Since I 'm having monthyear column as text data type.
Example , I'm selecting the Month - july,2023 and result will be July2023 - june2023 the difference.
It would change dynamically based on the month selection.
Solved! Go to Solution.
Hi @francisjohn83 ,
You can try using the following dax:
Measure =
var _selectyear=SELECTEDVALUE('UploadAccounts'[MonthYear].[Year])
var _selectmonthnumber=SELECTEDVALUE('UploadAccounts'[MonthYear].[MonthNo])
var _current=SUMX( FILTER(ALL(UploadAccounts),YEAR('UploadAccounts'[MonthYear])=_selectyear&&MONTH('UploadAccounts'[MonthYear])=_selectmonthnumber),[Value])
var _last=SUMX( FILTER(ALL(UploadAccounts),YEAR('UploadAccounts'[MonthYear])=_selectyear&&MONTH('UploadAccounts'[MonthYear])=_selectmonthnumber-1),[Value])
return
_current - _last
Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @francisjohn83 ,
You can try using the following dax:
Measure =
var _selectyear=SELECTEDVALUE('UploadAccounts'[MonthYear].[Year])
var _selectmonthnumber=SELECTEDVALUE('UploadAccounts'[MonthYear].[MonthNo])
var _current=SUMX( FILTER(ALL(UploadAccounts),YEAR('UploadAccounts'[MonthYear])=_selectyear&&MONTH('UploadAccounts'[MonthYear])=_selectmonthnumber),[Value])
var _last=SUMX( FILTER(ALL(UploadAccounts),YEAR('UploadAccounts'[MonthYear])=_selectyear&&MONTH('UploadAccounts'[MonthYear])=_selectmonthnumber-1),[Value])
return
_current - _last
Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Since I used this calculation, but unfortunately it's not working fine,
User | Count |
---|---|
119 | |
78 | |
59 | |
52 | |
48 |
User | Count |
---|---|
171 | |
117 | |
61 | |
59 | |
53 |