March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a list of 53 measures that each have a unique calculation but the result of which can be compared to the other measures, I would like to find the Top N amongst these measures
KPIPerfSalesMeasureSelection = VAR _selecteditem = SELECTEDVALUE('KPI Performance Measures'[DaxMeasureName])
RETURN
IFERROR(SWITCH (
_selecteditem,
"New Retail HD Units Perf.",[New Retail HD Units Perf.],
"New Retail HD GPU Perf.",[New Retail HD GPU Perf.],
"New Retail Non-HD Units Perf.",[New Retail Non-HD Units Perf.],
"New Retail Non-HD GPU Perf.",[New Retail Non-HD GPU Perf.],
"New Retail PDI Costs per Unit Perf.",[New Retail PDI Costs per Unit Perf.],
"New Other Income Perf.",[New Other Income Perf.],
"Used Retail HD Units Perf.",[Used Retail HD Units Perf.],
"Used Retail HD GPU Perf.",[Used Retail HD GPU Perf.],
"Used Retail Non-HD Units Perf.",[Used Retail Non-HD Units Perf.],
"Used Retail Non-HD GPU Perf.",[Used Retail Non-HD GPU Perf.],
"Used Other income Perf.",[Used Other income Perf.],
"New Finance & Insurance Cases Perf.",[New Finance & Insurance Cases Perf.],
"New Finance & Insurance per Case Perf.",[New Finance & Insurance per Case Perf.],
"Used Finance &Insurance Cases Perf.",[Used Finance &Insurance Cases Perf.],
"Used Finance & Insurance per Case Perf.",[Used Finance & Insurance per Case Perf.],
"Used Retail Reconditioning per Unit Perf.",[Used Retail Reconditioning per Unit Perf.],
"New & Used Extended Warranty GPU Perf.",[New & Used Extended Warranty GPU Perf.],
"Rental Bikes Gross Profit Perf.",[Rental Bikes Gross Profit Perf.],
"Sales Personnel Expenses Perf.",[Sales Personnel Expenses Perf.],
"Sales Non-personnel Expenses Perf.",[Sales Non-personnel Expenses Perf.],
BLANK ()
),0)
My problem is, that using this measure takes a very long time to calculate and max out the memory of the visual, is there a better way to select the measures for Top N?
Example KPI:
New Retail HD GPU Perf. = ( ( [VS10805C1] / [VS10803C1] ) - ( [VS10805C2] / [VS10803C2] ) ) * [VS10803C1]
VS10805 is a reference to a data entry cell and C1 denoted whether it is based on what comparison I need
VS10805C1 = (
CALCULATE (
[FilteredFactDlrCompC1],
'Dimension InputReference'[InputReferenceAlternateKey] = "VS10805"
) * [CurrencyConvRate]
FilteredFactDlrCompC2 =
VAR C2Selection =
IF (
HASONEVALUE ( Comparison2Options[Comparison 2] ),
VALUES ( Comparison2Options[Comparison 2] ),
BLANK ()
)
RETURN
SWITCH (
C2Selection,
"All Markets",
CALCULATE (
[FilteredFactDlrCompC1],
REMOVEFILTERS ( 'Dimension Dealer'[BMCode] )
),
"Last Year",
CALCULATE (
[FilteredFactDlrCompC1],
SAMEPERIODLASTYEAR ( 'Dimension Date'[FullDateAlternateKey] )
)
)
I cannot use RANKX as the value I want to rank on doesn't exist in a table, only in the visual.
Solved! Go to Solution.
Instead of having the measure with the huge switch statement in it, create a new fields parameter and add all of the individual measures to that. when a user chooses which measure they want from the slicer it will only calculate the selected value, not all of them.
rather than having the current measure in the TopN filter and in the matrix, you would use the fields parameter.
Hi @johnt75 I want to show all of the measures in the switch statement in order to find the Top N of all those measures together, the user doesn't want to choose specific KPIs in this report.
I don't see how you can that without massively impacting on performance.
Do the KPIs need to dynamically adapt to slicers or filters? If not, you could precompute them, and the TOPN, in a calculated column or table. You would still get a performance hit during data refresh, but performance for the end users should be fine
create a fields parameter and use that both on the visual and as the parameter to TOPN in the visual filter
Hi @johnt75 thanks for your reply, I don't think I was clear with my problem so let me add some more context
I am selecting TopN like this:
My visual then looks like this:
Seems simple but this is very slow and will kill the memory usage of the Embedded capacity (A2)
Instead of having the measure with the huge switch statement in it, create a new fields parameter and add all of the individual measures to that. when a user chooses which measure they want from the slicer it will only calculate the selected value, not all of them.
rather than having the current measure in the TopN filter and in the matrix, you would use the fields parameter.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |