March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear Guru:
I want to write measure to rank material with the inventory value of previous month. I've created a measure to rank the material with current inventory value(selected period). I want to show the rank change between selected period and (selected period -1). below is the measure I create:
thanks for the help.
--Tonny
Hi @tonny_bwg ,
You can try using the following dax:
Measure =
var _selectYearMonth=SELECTEDVALUE('Table'[YearMonth])
var _date=
MINX(
FILTER(ALL('Table'),
'Table'[YearMonth]=_selectYearMonth),[Date])
var _maxdate=
EOMONTH(_date,-1)
var _mindate=
EOMONTH(_date,-2)
return
RANKX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>_mindate&&'Table'[Date]<=_maxdate),CALCULATE(SUM([Value])),,ASC)
Can you share sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you
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
could you please help to solve this issue?
Hi,Mr. LiuYang
appreciated your help. please use this sample file to create previous month's rank. thanks
the fact table is as below, and a Dim_date table, a dim_Area tbl, Dim_material table link to fact table.
my question is how to calcualte previous month rank based on current filter context.
thanks for your help.
--Tonny
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |