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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MattReckoner
Frequent Visitor

dax find 75/95/99 percentile and return value

Hi

i have an issue with Percentile/inc and exc calculations. 

My fact table contains of ProductName, ProjectName and Timing(seconds)

i need to find 75th 90th 99th timing percentiles for each ProductName. The problem with Percentile.INC/EXC formula is with odd combinations. For example i have 183 rows of 9029T ProductName for One ProjectName, the 99th percentile is 181,17 sorted row number. Dax percentile function returns me calculated Timing(seconds) somehow ine between 181 and 182 row. But i would need to round odds and return Timings(seconds) matching exactly a value from 181 row

How could i do it?

so far i made a measure 

MsrRowNo99th=CALCULATE(ROUND(COUNTROWS(FtblProd)-1)*99/100+1,0))

it returns me the row number from sorted table i would need to return 

calculatedColumn

CCRankTiming=

var ProductNames = FtblProd[ProductName]

var ProjectNames = FtblProd[ProjectName]

return

RANKX(Filter(FtblProd,FtblProd[ProductName]=ProductNames && FtblProd[ProjectName]=ProjectNames),FtblProd[Timing(seconds)],,ASC))

checked it and it shows me good ranking for my Timing

and as a third step added my last measure

MsrReturn99thT=MAXX(FILTER(FtblProd),CCRankTiming=MsrRowNo99th),FtblProd[Timing(seconds)])

and that one return me an error...maybe instead of filter i should pass virtual table with productname and projectname

Could anyone help? maybe all these steps can be done within one measure for each percentile? 

1 REPLY 1
some_bih
Super User
Super User

Hi @MattReckoner  check link with video for Percentile function in DAX. I hope this help.

https://dax.guide/percentile-exc/ 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors