Forum Discussion
Quartile calculation with multiple conditions
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
lbendlin , I have modified the original post to include an Excel example. I hope that provides enough detail. If not, let me know.
- lbendlin3 years ago
Super User
It would be something like this
Hours Quartile = SWITCH(TRUE(), sum('Table'[Sum of Hours])<calculate(PERCENTILE.INC('Table'[Sum of Hours],0.25),ALLSELECTED('Table')),1, sum('Table'[Sum of Hours])<calculate(PERCENTILE.INC('Table'[Sum of Hours],0.5),ALLSELECTED('Table')),2, sum('Table'[Sum of Hours])<calculate(PERCENTILE.INC('Table'[Sum of Hours],0.75),ALLSELECTED('Table')),3, 4)- Anonymous3 years agoNot applicable
Thanks Ibendlin. I am still having an issue with the percentile pieces:
calculate(PERCENTILE.INC('Table'[Sum of Hours],0.25),ALLSELECTED('Table'))The table that I am referencing has many line items that add up to the total 'sum of hours'. For instance, the max in the Hours column is 375. The line above appears to be looking at those individual line items to calculate the quartile vs the summed amount per a 'Unit Number'.
- lbendlin3 years ago
Super User
Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.