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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
datahub
Frequent Visitor

Help with Quartiles

Hi, I am trying to use the quartiles formulas, I have been using this formula, works but not with a measure, in a table context with summarized values:

Test Quartiles NEW =
VAR FirstQ =
    CALCULATE(
    PERCENTILEX.INC(Competencia,Competencia[INVERSION_USD],.25),
    ALLSELECTED())
VAR SecondQ =
    CALCULATE(
    PERCENTILEX.INC(Competencia,Competencia[INVERSION_USD],.5),
    ALLSELECTED())
VAR ThirdQ =
    CALCULATE(
    PERCENTILEX.INC(Competencia,Competencia[INVERSION_USD],.75),
    ALLSELECTED())
VAR ThisVal =
    SELECTEDVALUE(Competencia[INVERSION_USD])
    RETURN
    IF (ThisVal <= FirstQ, 1,
    IF(Thisval > FirstQ && ThisVal <= SecondQ, 2,
    IF (ThisVal > SecondQ && ThisVal <= ThirdQ,3,4)))
 
Right now it works in this context:
 
Works this wayWorks this way
 
What I would like to do is use with the measure context (summarizing all values), I already know to make it to work with a disconnected summarized virtual table, but I need it to make it to work with all existing relationships (with other tables) on main "Competencia" Table.
So I would appreciate your help.
 
This is the context I would need to make it to work. Thanks:

Power BI Measure Context.png
1 REPLY 1
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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