Forum Discussion
TOPN Filtering by a Measure Workaround (Live semantic Model Connection)
- 2 years ago
Hi Anonymous - To achieve the desired "Top 10 parts by a measure" visualization by using DAX.
Create a measure to rank your parts
RankMeasure =
RANKX(
ALL('PartsTable'),
[YourMeasure],
,
DESC,
DENSE
)you can replace PartsTable with the name of your table .
In the "Filters on this visual" pane, drag RankMeasure and set it to <= 10.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!! - Anonymous2 years ago
Hi Anonymous ,
Thanks for the reply from rajendraongole1 and Ashish_Mathur , please allow me to provide another insight:
You can try this measure.
Top10Parts = SUMX ( TOPN ( 10, SUMMARIZE ( PartsTable, PartsTable[PartID], "MeasureValue", [YourMeasure] ), [YourMeasure], DESC ), [YourMeasure] )For more details please refer to the document:
TOPN function (DAX) - DAX | Microsoft Learn
Measures in Analysis Services tabular models | Microsoft Learn
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share some data to work with and show the expected result. Share data in a format that can be pasted in an MS Excel file.