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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.