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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
FOXYBARK
Helper II
Helper II

Percentile calc to remain constant on day but update on dimension filter use

HI there. 

Here is my table of data. 

FOXYBARK_0-1744747645879.png

Here is my proposed calc. I crafted this from another Fabric post. This calc works but does not provide my desired number. 

FOXYBARK_1-1744747701722.png

I am trying to get the 90th percentile for each floor. THis needs to remain constant across days. [PeopleCounts] are simply SUM(VALUE). 

Below is my ideal output. A constant line - 90th percentile line across days for each floor when I use a floor slicer. 

FOXYBARK_2-1744747942414.png

Thanks, F

1 ACCEPTED SOLUTION

I will reply to my own post with the measure that worked. This calc did exactly what I needed it to do.

Measure = PERCENTILEX.INC(
    ALLSELECTED('August Badge Data'[Date]),
    CALCULATE(
        SUM('August Badge Data'[Value])),.9)

Thanks

View solution in original post

9 REPLIES 9
v-kpoloju-msft
Community Support
Community Support

Hi @FOXYBARK,
Thank you for reaching out to the Microsoft fabric community forum.

After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.    

Dax Measure for Creating 90th Percentile:

90th Percentile =

IFERROR(

    PERCENTILEX.INC(

        CALCULATETABLE(

            'August Badge Data',

            REMOVEFILTERS('August Badge Data'[Date])

        ),

        'August Badge Data'[Value],

        0.9

    ),

0)

 

vkpolojumsft_0-1744788919464.png

I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

Hi there @v-kpoloju-msft Thank you for this. There is one added layer to this and I made the small modification in your sample workbook. I'd like the values summed by day and then the percentile calculated off the summed values. For example, now the 5th floor, 90th percentile is 31.4. Correction: I cannot attach the .pbi file so here are some screenshots of what I did. How would you modify your calculation to account for this please?

FOXYBARK_0-1744815875424.png

FOXYBARK_2-1744816067996.png

 

Hi @FOXYBARK,
Thank you for the update and clarification.

You are correct, To calculate the 90th percentile, we should use the daily summed values per Date instead of the raw data.

To do this, I suggest adjusting the DAX to first summarize the Value by day and then apply PERCENTILEX.INC over those results. Here is a measure that should meet your requirements:

90th Percentile Daily Total =

VAR FloorFilter = SELECTEDVALUE('YourTable'[Floor])

VAR DailySums =

    ADDCOLUMNS(

        SUMMARIZE(

            'YourTable',

            'YourTable'[Date]

        ),

        "DailyTotal",

        CALCULATE(

            SUM('YourTable'[Value]),

            'YourTable'[Floor] = FloorFilter

        )

    )

RETURN

    PERCENTILEX.INC(DailySums, [DailyTotal], 0.9)

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

Beautiful. And how to keep the percentile constant across all dates? @v-kpoloju-msft 

Hi @FOXYBARK,

Thank you for the kind words, I’m glad the measure worked for you.

 

To keep the 90th percentile constant across all dates, you’ll need to remove the current date context from the calculation so that the percentile is calculated once over the entire dataset (filtered by Floor, if applicable), and then the same value is shown regardless of the date in the visual. You can update your measure like this:

90th Percentile Daily Total (Constant) =

 

VAR FloorFilter = SELECTEDVALUE('YourTable'[Floor])

 

VAR DailySums =

    ADDCOLUMNS(

        SUMMARIZE(

            'YourTable',

            'YourTable'[Date]

        ),

        "DailyTotal",

        CALCULATE(

            SUM('YourTable'[Value]),

            'YourTable'[Floor] = FloorFilter,

            REMOVEFILTERS('YourTable'[Date])

        )

    )

 

RETURN

    PERCENTILEX.INC(DailySums, [DailyTotal], 0.9)


The key change is the use of REMOVEFILTERS('YourTable'[Date]) inside the CALCULATE function, which ensures that the date context does not affect the percentile calculation making it constant across the visual.

If this helps, please consider giving a "Kudos" or marking it as Accepted Solution to assist others in the community.

 

Thanks again for using the Microsoft Community Forum!

Hi @FOXYBARK,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Hi. 

This did not work as the adding the REMOVEFILTER function provided a constant of all summed values for the floor, it did not provide a 90th percentile value. 

FOXYBARK_0-1745246296192.png

 

I will reply to my own post with the measure that worked. This calc did exactly what I needed it to do.

Measure = PERCENTILEX.INC(
    ALLSELECTED('August Badge Data'[Date]),
    CALCULATE(
        SUM('August Badge Data'[Value])),.9)

Thanks
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

"); $(".slidesjs-pagination" ).prependTo(".pagination_sec"); $(".slidesjs-pagination" ).append("
"); $(".slidesjs-play.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-stop.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-pagination" ).append(""); $(".slidesjs-pagination" ).append(""); } catch(e){ } /* End: This code is added by iTalent as part of iTrack COMPL-455 */ $(".slidesjs-previous.slidesjs-navigation").attr('tabindex', '0'); $(".slidesjs-next.slidesjs-navigation").attr('tabindex', '0'); /* start: This code is added by iTalent as part of iTrack 1859082 */ $('.slidesjs-play.slidesjs-navigation').attr('id','playtitle'); $('.slidesjs-stop.slidesjs-navigation').attr('id','stoptitle'); $('.slidesjs-play.slidesjs-navigation').attr('role','tab'); $('.slidesjs-stop.slidesjs-navigation').attr('role','tab'); $('.slidesjs-play.slidesjs-navigation').attr('aria-describedby','tip1'); $('.slidesjs-stop.slidesjs-navigation').attr('aria-describedby','tip2'); /* End: This code is added by iTalent as part of iTrack 1859082 */ }); $(document).ready(function() { if($("#slides .item").length < 2 ) { /* Fixing Single Slide click issue (commented following code)*/ // $(".item").css("left","0px"); $(".item.slidesjs-slide").attr('style', 'left:0px !important'); $(".slidesjs-stop.slidesjs-navigation").trigger('click'); $(".slidesjs-previous").css("display", "none"); $(".slidesjs-next").css("display", "none"); } var items_length = $(".item.slidesjs-slide").length; $(".slidesjs-pagination-item > button").attr("aria-setsize",items_length); $(".slidesjs-next, .slidesjs-pagination-item button").attr("tabindex","-1"); $(".slidesjs-pagination-item button").attr("role", "tab"); $(".slidesjs-previous").attr("tabindex","-1"); $(".slidesjs-next").attr("aria-hidden","true"); $(".slidesjs-previous").attr("aria-hidden","true"); $(".slidesjs-next").attr("aria-label","Next"); $(".slidesjs-previous").attr("aria-label","Previous"); //$(".slidesjs-stop.slidesjs-navigation").attr("role","button"); //$(".slidesjs-play.slidesjs-navigation").attr("role","button"); $(".slidesjs-pagination").attr("role","tablist").attr("aria-busy","true"); $("li.slidesjs-pagination-item").attr("role","list"); $(".item.slidesjs-slide").attr("tabindex","-1"); $(".item.slidesjs-slide").attr("aria-label","item"); /*$(".slidesjs-stop.slidesjs-navigation").on('click', function() { var itemNumber = parseInt($('.slidesjs-pagination-item > a.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); });*/ $(".slidesjs-stop.slidesjs-navigation, .slidesjs-pagination-item > button").on('click keydown', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); var itemNumber = parseInt($('.slidesjs-pagination-item > button.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); }); $(".slidesjs-play.slidesjs-navigation").on('click', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); }); $(".slidesjs-pagination-item button").keyup(function(e){ var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); $(".slidesjs-stop.slidesjs-navigation").trigger('click').blur(); $("button.active").focus(); } }); $(".slidesjs-play").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-stop").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-play")) { $(".slidesjs-stop").focus(); } } }); $(".slidesjs-stop").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-play").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-stop")) { $(".slidesjs-play").focus(); } } }); $(".slidesjs-pagination-item").keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".slidesjs-previous.slidesjs-navigation").trigger('click'); e.preventDefault(); break; case 39: //right arrow key $(".slidesjs-next.slidesjs-navigation").trigger('click'); e.preventDefault(); break; default: return; } $(".slidesjs-pagination-item button.active").focus(); }); }); // Start This code is added by iTalent as part of iTrack 1859082 $(document).ready(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); $("#tip2").attr("aria-hidden","true").addClass("hidden"); $(".slidesjs-stop.slidesjs-navigation, .slidesjs-play.slidesjs-navigation").attr('title', ''); $("a#playtitle").focus(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").mouseover(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").blur(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#playtitle").mouseleave(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#play").keydown(function(ev){ if (ev.which ==27) { $("#tip1").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); $("a#stoptitle").focus(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").mouseover(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").blur(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").mouseleave(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").keydown(function(ev){ if (ev.which ==27) { $("#tip2").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); }); // End This code is added by iTalent as part of iTrack 1859082
Top Kudoed Authors