Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi all
I need to add a measure that returns me in descendent order an index updated to any slicer I choose.
This is the table that for sensitive matters I cut the data:
In the example above I am selecting one product which is produced in 6 different locations (that's why it appeats 6 times above)
The correct result should be from 1 to 6 because they all have different demand.
The measure I have is the following:
Index =
RANKX (
FILTER (
ALLSELECTED ( 'SKU by line - Official' ),
'SKU by line - Official'[Country of Manufacturing]
= MAX ( 'SKU by line - Official'[Country of Manufacturing] )
&& 'SKU by line - Official'[Manufacturing plant of production]
= MAX ( 'SKU by line - Official'[Manufacturing plant of production] )
&& 'SKU by line - Official'[Manufacturing line]
= MAX ( 'SKU by line - Official'[Manufacturing line] )
&& 'SKU by line - Official'[Package material]
= MAX ( 'SKU by line - Official'[Package material] )
&& 'SKU by line - Official'[Refilability]
= MAX ( 'SKU by line - Official'[Refilability] )
&& 'SKU by line - Official'[Volume]
= MAX ( 'SKU by line - Official'[Volume] )
&& 'SKU by line - Official'[Category]
= MAX ( 'SKU by line - Official'[Category] )
&& 'SKU by line - Official'[Product name]
= MAX ( 'SKU by line - Official'[Product name] )
&& 'SKU by line - Official'[Date]
= MAX ( 'SKU by line - Official'[Date] )
),
CALCULATE ( [Demand by bottler (Year +1)] ),
,
DESC,
DENSE
)
How can I get it right?
Please click on the image to see right resolution.
Thanks.
Solved! Go to Solution.
@o59393 try new INDEX function as shown below:
Index =
RANK (
DENSE,
ALLSELECTED (
'SKU by line - Official'[Country of Manufacturing],
'SKU by line - Official'[Manufacturing plant of production],
'SKU by line - Official'[Manufacturing line],
'SKU by line - Official'[Line Efficiency (real) Year 1],
'SKU by line - Official'[Product name]
),
ORDERBY ( [Demand by bottler (Year +1)], DESC )
)
Output
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@o59393 try new INDEX function as shown below:
Index =
RANK (
DENSE,
ALLSELECTED (
'SKU by line - Official'[Country of Manufacturing],
'SKU by line - Official'[Manufacturing plant of production],
'SKU by line - Official'[Manufacturing line],
'SKU by line - Official'[Line Efficiency (real) Year 1],
'SKU by line - Official'[Product name]
),
ORDERBY ( [Demand by bottler (Year +1)], DESC )
)
Output
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@o59393 sounds good, it will be much easier. Cheers!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @parry2k
See for example in the image below that when I use a slicer, the index is now showing 1,2,3,4,etc by each row (which is what I'd like to have).
Also note that the total is 1 but it should be 4 because it showed 4 rows/results.
Thanks for your help once again.
@o59393 it is hard to work thru these screen shots, you need to put together some sample data in a pbix file and share, mainly following what your data model looks like.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@o59393 not sure how your model look like, also why you are using MAX:
Index =
RANKX (
ALLSELECTED ( 'SKU by line - Official' ),
CALCULATE ( [Demand by bottler (Year +1)] ),
,
DESC,
DENSE
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @parry2k
The Index changes but still doesn't do the incremental by 1 in each row:
See the demand column which has different values and the index (first column) stills repeats values.
Thanks.
User | Count |
---|---|
77 | |
77 | |
67 | |
65 | |
47 |
User | Count |
---|---|
108 | |
105 | |
93 | |
83 | |
64 |