Forum Discussion

whoopsy's avatar
whoopsy
New Member
3 years ago

Measure Trouble with Percent Total

Hi all,

 

I’m been struggling with this and would be ridiculously appreciative for any guidance.

I have a table RequestMetrics with Column METER_NAME.  METER_NAME has the format $REQUESTNAME_$SUCCESSORFAILTYPE_COUNT.

 

RequestMetrics

 

My goal is to get a Current Filtered % for each request type and compare it to a Historical %.

Historical I’ve achieved with below measures (for something like AOTSCREATETKT, it’s 21% DATA_NOT_FOUND, 10% FAILURE, 68% SUCCESS)

 

DashboardTable

 

 

HISTORICAL COUNT BY NAME =
var meter=LASTNONBLANK(RequestLookup[REQUEST_NAME],[REQUEST_NAME])
return CALCULATE(SUM(RequestMetrics[METER_VALUE]), FILTER(ALL(RequestMetrics), [METER_NAME]=meter))
 
HISTORICAL COUNT BY BASE =
var meter=LASTNONBLANK(RequestLookup[REQUEST_BASE_TYPE],[REQUEST_BASE_TYPE])
return CALCULATE(SUM(RequestMetrics[METER_VALUE]), FILTER(ALL(RequestMetrics), [BASE_TYPE]=meter))

 

 

For the Current Filtered %, I want it to respond to the date, time, system, server filters on the page. 

The numerator, FILTERED MEASURE COUNT BY NAME, seems ok.  The denominator, FILTERED MEASURE COUNT BY BASE, does not work. 

 

FILTERED MEASURE COUNT BY NAME =
var meter=LASTNONBLANK(RequestLookup[REQUEST_NAME],[REQUEST_NAME])
return CALCULATE(SUM(RequestMetrics[METER_VALUE]), FILTER(RequestMetrics, [METER_NAME]=meter)
 
FILTERED MEASURE COUNT BY BASE =
var meter=LASTNONBLANK(RequestLookup[REQUEST_BASE_TYPE],[REQUEST_BASE_TYPE])
return CALCULATE(SUM(RequestMetrics[METER_VALUE]), FILTER(RequestMetrics, [BASE_TYPE]=meter))

 

I’ve tried a number of ways.   If I create a separate table with $REQUESTNAME keys (AOTSGETTKT, AOTSCREATETKT, etc), it displays correctly on its own.  If I add it as a column to above table or try to calculate the percentage, it doesn’t work. 

 

tldr – I need, for example, AOTSCREATETKT_DATA_NOT_FOUND_COUNT + AOTSCREATETKT_SUCCESS_COUNT + AOTSCREATETKT_FAILURE_COUNT and have it be responsive to the dashboard slicers.

 

Here's a screenshot of related RequestLookup table

 

RequestLookup

 

 

Thank you! – Dan

2 Replies