Forum Discussion
Adding fields is impacting results
Using the following Dax to create top sales by part number. The total sales by part number come out correctly but when a description is added the result is impacted. For example, selecting top 5 without description yields 5 results. This is correct and the sales total is also correct. Adding the description changes the display and results seem to be unfiltered when the description is added. The grand total still shows for the top 5 but all part number results are displayed. The description is coming from invoiced sales and is not a unique field.
- Solved the issue. Added another field to the rankx calculation for description. Once this was implemented the problem solved.Total PN ales by Rank TEST =VARRankingDimesion=Values(Sales[Material])VarRankingSelect = [Ranking Select PN]ReturnCALCULATE([Total Sales],Filter( RankingDimesion,RankX(all(Sales[Material], Sales[Description]) ,[Total Sales], ,desc )<= RankingSelect))
3 Replies
- lbendlin
Super User
"The description is coming from invoiced sales and is not a unique field. "
The description needs to come from the same row of the table where you get the part number from.
- m_wex
Helper I
The invoiced sales material and description are both coming from the same table.
- m_wex
Helper I
Solved the issue. Added another field to the rankx calculation for description. Once this was implemented the problem solved.Total PN ales by Rank TEST =VARRankingDimesion=Values(Sales[Material])VarRankingSelect = [Ranking Select PN]ReturnCALCULATE([Total Sales],Filter( RankingDimesion,RankX(all(Sales[Material], Sales[Description]) ,[Total Sales], ,desc )<= RankingSelect))