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,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
101 | |
66 | |
48 | |
39 | |
32 |
User | Count |
---|---|
166 | |
112 | |
60 | |
56 | |
37 |