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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
sanct
Frequent Visitor

Grouping Selected Rows and Calculating Value in One of those Rows

Hi All,

 

I have a bit of a bizarre data model that I'm trying to work with.  Here's a snapshot of it:

 

group.png

 

Background

 

My org conducts a survey across multiple categories for our members. As exported from the survey, the results are very difficult to analyze, containing 640 columns with related information split across multiple columns. For example (drawing on the chart above), an organanization may have multiple departments that we're analyzing, and so there is a column for "Department 1 - Department Size", "Department 1 - Department Name", "Department 1 - Sales" and they repeat for as many as 15 departments.

 

In the example above I include only the topic "Food", but assume I also have 8 other topics that come from this data export.

 

My First Solution

 

My first solution was to conduct a number of transformations (including an unpivot columns) on the data in order to break everything into less than 10 columns.

 

The ones I want to focus on are:

 

1. [Section]: an integer value for the section

2. [Topic]: a string describing the section

3. [Dimension]: a first-level break down/grouping of overlapping columns (i.e. a way of grouping departments from the example above)

4. [Sub-Dimension]: a second-level break down of overlapping columns (i.e. a way of identifying the specific departments, so in the example above, this is where I would specify that this is "department 1", or "department 2" etc)

5. [Sub-Sub-Dimension]: the final break down level where I can specify the common discrete variables that I'm measuring (i.e. "Department Name", "Department Size", "Sales")

6. [Value]: string value of the results from the original columns in the survey export

7. [Num Value]: a custom column that fetches number values from [Values] and returns them in a column where I can run sums and other measures.

 

This works fairly well. I can use DAX to create calculated tables of dimensions that filter the central table--overall a nice and clean snowflake schema, as below:schema.png

I use DAX to create measures that calculate based on the selected dimension table. It all actually works really well until I get to the category I'm discussing here.

 

The Problem

 

So I'm not sure how to calculate the total sales, filtered by the department size categories (i.e. "0-9","10-500","500+"). I have a suspicion that I can use the sub-dimension (i.e. "1","2","3", etc) to group rows, but I'm not sure how to go about doing this. I'm not actually sure this is possible.

 

Any help would be appreciated.

 

 

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @sanct ,

Maybe you can consider add calculated column with custom numeric range and mark as category and add a bridge table with these category to link tables.
After these, you can then use this category column to create a slicer to filter multiple tables.
.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @sanct ,

Maybe you can consider add calculated column with custom numeric range and mark as category and add a bridge table with these category to link tables.
After these, you can then use this category column to create a slicer to filter multiple tables.
.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors