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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jackson56
Frequent Visitor

Create Different Groups From One Datasource based on End User Specifications

Hello,

 

I am trying to create a "calculator" of sorts where an end user can specify 2 groups from multiple fields. I would then like to use these groups for further analysis. For Example:

 

Based on this made up data

 

DepartmentSexRacePayhours
ITMWhite$58,392.061950.00
HRMBlack$55,000.001950.00
ITMWhite$100,410.001950.00
ITMWhite$105,019.201950.00
AdminFBlack$66,834.161950.00
AdminMWhite$70,654.351950.00
FinanceMAsian$97,890.841950.00
HRMAsian$77,760.001950.00
FinanceMWhite$88,932.171950.00
ExecMWhite$79,008.751950.00
AdminMAsian$92,102.401950.00
FieldFAsian$129,729.601950.00
FieldFWhite$193,818.851950.00
FieldFBlack$135,000.001950.00
FieldMWhite$75,600.001950.00

 

Say an end user was interested in compensation differences between group 1 (Black Females) and group 2 (Asian Men). The user would use slicers (or something) to choose "Black" for group 1's Race category and "F" for group 1's Sex category. This info would be "saved" as "Group 1".

 

Group 1    
     
AdminFBlack$66,834.161950.00
FieldFBlack$135,000.00

1950.00

 

The same would be done for Group 2. 

 

Group 2    
     
FieldMAsian$97,890.841950.00
HRMAsian$77,760.001950.00
AdminMAsian$92,102.401950.00

 

From these groups, I would like to do group 1 vs group 2 vs overall total comparisons such as average compensation across department, % below meadin pay, gap %, etc. 

 

Originally, I tried working with one table, but this doesn't allow for the end user to create groups since using one set of slicers filters out the other options. Having slicers only affect certain viz's works until I try to combine the groups for things like "total employees across the two groups" or clustered bar charts. My current fix is to copy the original table so each group can have a "clean slate" to start from but this doesn't allow for visualizations like clustered bars either. Another thought I had was to copy, union, and create a new "group" field - 2 records per row, one for each group but then I'd basically have to recreate each field and filter based on the new "group" field.

 

Any suggestions are appreciated. 

6 REPLIES 6
Jackson56
Frequent Visitor

For anyone who finds this thread in the future, the following link did what I was looking for. I had to create new fields for each calculation so it's not a solution for a larger dataset. 

 

https://techcommunity.microsoft.com/t5/fasttrack-for-azure/comparative-analysis-by-different-values-...

Anonymous
Not applicable

Hi @Jackson56 ,

You can create a calculator for each group.

The following DAX might work for you:

 

Group1 = 
CALCULATETABLE(
    'Table',
    FILTER(
        'Table',
        'Table'[Sex] = "F" && 'Table'[Race] = "Black"
    )
)


Group2 = 
CALCULATETABLE(
    'Table',
    FILTER(
        'Table',
        'Table'[Sex] = "M" && 'Table'[Race] = "Asian"
    )
)

 

The final output is shown in the following figure:

vxiandatmsft_0-1710125743877.pngvxiandatmsft_1-1710125788809.pngvxiandatmsft_2-1710125797347.png

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Would this allow for end users to choose the criteria for each group?

Anonymous
Not applicable

Hi @Jackson56 ,

Unfortunately it is static, and at the time of founding the calculation group, its conditions were specified

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Enable "Personalize Visuals"  and teach your users how to use it.

lbendlin
Super User
Super User

 My current fix is to copy the original table so each group can have a "clean slate" to start from but this doesn't allow for visualizations like clustered bars either.

It does when you use explicit measures.

 

I would think a matrix visual or scatter plot may be appropriate.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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