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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nutyfreshz
Frequent Visitor

Quartile Labels

Screenshot_12.png

I want to labels frequency column each customer(linelog) as quartile calculate

but f_quatile apeared only Q4.

 

f_quartile = 
VAR frequent =
    SUM ( '040222_Villa_RFAnalysis'[frequency] )
VAR CustomerList =
    GROUPBY (
        ALL ( '040222_Villa_RFAnalysis' ),
        '040222_Villa_RFAnalysis'[lineLog],
        "Val", SUMX ( CURRENTGROUP (), [frequency] )
    )
VAR Percentile50 =
    MEDIANX ( CustomerList, [Val] )
VAR Percentile75 =
    MEDIANX ( FILTER ( CustomerList, [Val] >= Percentile50 ), [Val] )
VAR Percentile25 =
    MEDIANX ( FILTER ( CustomerList, [Val] < Percentile50 ), [Val] )
RETURN
    IF (
        frequent >= Percentile75,
        "Q4",
        IF ( frequent >= Percentile50, "Q3", IF ( frequent >= Percentile25, "Q2", "Q1" ) )
    )

 

I miss anythings?

Thank you.

1 REPLY 1
lbendlin
Super User
Super User

@nutyfreshz Do you have enough data points to disambiguate the quartiles?  Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Please show the expected outcome.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.