Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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 February 2025 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
82 | |
57 | |
41 | |
39 |