Forum Discussion

itchyeyeballs's avatar
itchyeyeballs
Icon for Impactful Individual rankImpactful Individual
1 year ago
Solved

PercentileX.INC returns blank

Hi all,

 

I'm trying to do a simple percentilex.inc calculation but the result is returning blank unless I manually select all the values I am grouping on.

The DAX is 

PERCENTILEX.INC(VALUES(Table1[Group1]),[KPI],.5)

[KPI] is just a simple measure based on two integer fields

KPI = DIVIDE(
			[KPI_Numerator],
			[KPI_Denominator]
		)



If I add a slicer and manually select all the group1 values then a result is shown, however if I "select all" in the slicer it returns to blank.

I have added a filer on the report so there are no blank or empty group1 values. 

Any suggestions as to how I can resolve?

  • itchyeyeballs's avatar
    itchyeyeballs
    1 year ago

    Thank you, you helped me get on the right track.

    I got it working with

     

     

    = PERCENTILEX.INC(
    			Summarize(
    				Facttable,
    				Table1[Group1])
    			),
    			[KPI],
    			0.5
    		)

     

     

    I still have no idea why values acted as it did though.

    Once I was happy it was workng I enhanced it to enable me to filter out smaller groups

     

     

    KPI = PERCENTILEX.INC(
    			FILTER(
    				ALLSELECTED(Table1[Group1]),
    				[KPI_Denominator] >= 5
    			),
    			[KPI],
    			0.5
    		)

     

     

     

2 Replies

  • itchyeyeballs , Try below method

     

    Use ALL Function: Modify your DAX formula to use the ALL function to ignore any filters on Table1[Group1]. This can help in ensuring that the percentile calculation considers all values regardless of the slicer selection.

     

    PERCENTILEX.INC(ALL(Table1[Group1]), [KPI], 0.5)


    Check KPI Calculation: Ensure that the [KPI] measure is correctly calculated and does not return blank or error values. You can add a check to handle any potential division by zero or other issues:

     

    KPI = IF(
    ISBLANK([KPI_Denominator]) || [KPI_Denominator] = 0,
    BLANK(),
    DIVIDE([KPI_Numerator], [KPI_Denominator])
    )
    Debugging: Create a table visualization to display the values of Table1[Group1] and [KPI] to ensure that the data is as expected and there are no unexpected blanks or errors.

    • itchyeyeballs's avatar
      itchyeyeballs
      Icon for Impactful Individual rankImpactful Individual

      Thank you, you helped me get on the right track.

      I got it working with

       

       

      = PERCENTILEX.INC(
      			Summarize(
      				Facttable,
      				Table1[Group1])
      			),
      			[KPI],
      			0.5
      		)

       

       

      I still have no idea why values acted as it did though.

      Once I was happy it was workng I enhanced it to enable me to filter out smaller groups

       

       

      KPI = PERCENTILEX.INC(
      			FILTER(
      				ALLSELECTED(Table1[Group1]),
      				[KPI_Denominator] >= 5
      			),
      			[KPI],
      			0.5
      		)