RankX Matrix Total doesn't match Card Total

Hi,

I have put together a Product Ranking Matrix and want to show the Total from the Column Matrix for Top Products on a Card but I am getting a slightly different number and cannot figure out why so hopefully one of the kind EDNA soouls can help.

Thanks

Chris

Measures

This Ranks the Top Products with the amount of products to be Ranked selected on a Slicer that sets TopN Value

Ranking TopN Products =
VAR ProductsToRank = [TopN Value]
VAR SalesAmount = [Sales (PI)]
VAR Ranking =
RANKX (ALLSELECTED ( Products[Description] ), SalesAmount)
RETURN
IF ( Ranking > 0 && Ranking <= ProductsToRank, Ranking )

This Calculates a 1 or a 0 which is used to hide the o’s which are products where the Ranking is greater than the MAX on the Slider

Visible Row =
VAR Ranking = [Ranking TopN Products]
VAR TopNValue = [TopN Value]
VAR Result =
IF (
NOT ISBLANK ( Ranking ),
( Ranking <= TopNValue ) - ( Ranking = TopNValue + 1 )
)
RETURN
Result

This is the Total Products Measure which is shown on teh Card and the Matrix below.
Top Products =

SUMX(VALUES(Products[Description]),

IF( [Ranking TopN Products] <= 'TopN'[TopN Value] && [Visible Row] > 0, [Sales (PI)]))

Note the Top Products Total

This is the same measure on a Card

image

As you can see the difference is around £1280 with 28000 products being Ranked.

Hope this makes sense, any help is appreciated as it has to be something daft.

Hi @chris.turnbull.

To help us further analyze your current state and visualize your issue, could you please provide as many as you can of:

  • Your work-in-progress PBIX file, using sanitized data if necessary
  • Your dataset as an Excel file (again, sanitized if necessary)
  • A detailed mock-up (marked-up screenshot or Excel file) of your desired outcome.

Also, if you provide DAX in your post, please format it using the built-in formatter.

Greg

_eDNA Forum - Format DAX

1 Like

Hi @chris.turnbull, we’ve noticed that no response has been received from you since the 31st of March.

We are waiting for the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.