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

View all the Fabric Data Days sessions on demand. View schedule

Reply
rhancharick
New Member

Column that shows Quartile assignment and will recalculate based on Filters

Hello - I am stumped and need some help.  My objective is to add a column to either my dim or fact table that designates what quartile my dim (stores) belongs to based on the fact (sales amount).  I can accomplish this using the Switch function, however the quartile assignments are static and do not change when I filter by region for example.

 

The dim table has StoreID and Region 

The fact table has StoreID and Total Sales Amount

 

The desired outcome is to have a new column that indicates the quartile that store is assigned to (Q1, Q2, etc).  And if I select a specific region, then I would like the store that remain after the filter is applied to have their quartile assignments reevaluated based on the new subset of stores and NOT the entire populatoin of stores.  

 

Below is the calculated column formula I used to accomplish the static version of this quartile 

Quartile Indicator =

SWITCH(TRUE(),

    [Total Sales Amount] <= PERCENTILEX.INC(Sales', [Total Sales Amount], 0.25), "D",

    [Total Sales Amount]<= PERCENTILEX.INC(Sales', [Total Sales Amount], 0.5), "C",

    [Total Sales Amount] <= PERCENTILEX.INC(Sales', [Total Sales Amount], 0.75), "B",

    [Total Sales Amount]> PERCENTILEX.INC(Sales', [Total Sales Amount], 0.75), "A"

)

Thank you in advance

 

 

1 ACCEPTED SOLUTION
rhancharick
New Member

Chat GPT gave me the answer.  Works for me!

 

Quartile Indicator by Channel =

SWITCH(

    TRUE(),

    [Total Sales Amount] <= PERCENTILEX.INC(FILTER(Sales', Sales'[Channel] = EARLIER(Sales'[Channel])), [Total Sales Amount], 0.25), "D",

    [Total Sales Amount] <= PERCENTILEX.INC(FILTER(Sales', Sales'[Channel] = EARLIER(Sales'[Channel])), [Total Sales Amount], 0.5), "C",

    [Total Sales Amount] <= PERCENTILEX.INC(FILTER(Sales', Sales'[Channel] = EARLIER(Sales'[Channel])), [Total Sales Amount], 0.75), "B",

    [Total Sales Amount] > PERCENTILEX.INC(FILTER(Sales', Sales'[Channel] = EARLIER(Sales'[Channel])), [Total Sales Amount], 0.75), "A"

)

View solution in original post

1 REPLY 1
rhancharick
New Member

Chat GPT gave me the answer.  Works for me!

 

Quartile Indicator by Channel =

SWITCH(

    TRUE(),

    [Total Sales Amount] <= PERCENTILEX.INC(FILTER(Sales', Sales'[Channel] = EARLIER(Sales'[Channel])), [Total Sales Amount], 0.25), "D",

    [Total Sales Amount] <= PERCENTILEX.INC(FILTER(Sales', Sales'[Channel] = EARLIER(Sales'[Channel])), [Total Sales Amount], 0.5), "C",

    [Total Sales Amount] <= PERCENTILEX.INC(FILTER(Sales', Sales'[Channel] = EARLIER(Sales'[Channel])), [Total Sales Amount], 0.75), "B",

    [Total Sales Amount] > PERCENTILEX.INC(FILTER(Sales', Sales'[Channel] = EARLIER(Sales'[Channel])), [Total Sales Amount], 0.75), "A"

)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors