Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
m_wex
Helper I
Helper I

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. 

 

Total PN ales by Rank TEST =
VAR
RankingDimesion=Values(Sales[Material])
Var
RankingSelect = [Ranking Select PN]
Return
CALCULATE([Total Sales],
Filter( RankingDimesion,
RankX(ALL(Sales[Material]) ,[Total Sales], ,desc )<= RankingSelect))
1 ACCEPTED SOLUTION
m_wex
Helper I
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 =
VAR
RankingDimesion=Values(Sales[Material])
Var
RankingSelect = [Ranking Select PN]
Return
CALCULATE([Total Sales],
Filter( RankingDimesion,
RankX(all(Sales[Material], Sales[Description]) ,[Total Sales], ,desc )<= RankingSelect))

View solution in original post

3 REPLIES 3
m_wex
Helper I
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 =
VAR
RankingDimesion=Values(Sales[Material])
Var
RankingSelect = [Ranking Select PN]
Return
CALCULATE([Total Sales],
Filter( RankingDimesion,
RankX(all(Sales[Material], Sales[Description]) ,[Total Sales], ,desc )<= RankingSelect))
lbendlin
Super User
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.

The invoiced sales material and description are both coming from the same table. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors