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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

SUM unique values from filtered table

Hello, everyone! I am new in Power BI, and I haven't been able to start my dataviz because I'm stuck with the data transformation. 

 

I have a data set that is essentially this. 

powerbi1995_1-1634311485992.png

 

 

I have a "nested" product list with "repeated" information about the stores. If you see, I have different stores in each country, but the values from Store Class and Employees are the same information for the same store ID. 

The Store ID is unique, regardless of the country.

The Store Class is not unique. 

 

What I need to calculate is the total number of employees in different scenarios. 

  • Total employees per country
  • Total employees per store class per country 

For example, I manually calculated the values from Luxembourg in Excel and this is how I would want to calculate the values automatically in Power BI

Total employees per country: 98

Total employees per country per store class: 

  • Class A: 50
  • Class B: 25
  • Class C: 3
  • Class 😧 20

powerbi1995_2-1634312293736.png

 

I am trying to calculate this as either another column and this would give me repeated values.  Or as a measure, that I can then use in my data visualization as a Card with a filter. 

 

Any help will be much appreciated!  

5 REPLIES 5
Anonymous
Not applicable

Hi @smpa01 this helps for this simple data set, indeed. 

 

The problem is that my actual dataset has thousands of "Countries" (I know there are not thousands of countries, but I changed the field names to share the dataset structure haha)

 

I was hoping to get a way to calculated with DAX measures so that I can then add Card visualizations with a slicer to select the Country I want to see or the class of store I want to see or both. 

 

Do you know any solution for this? 

Thanks a lot! 

Hi, @Anonymous 

It looks like [base] measure created by @smpa01  can meet your needs. I didn't find any error in his measure. The card can be filtered properly. Please recheck it.

98.png

 

 

If I have misunderstood,  please explain your needs in more detail.

 

Best Regards,
Community Support Team _ Eason

smpa01
Super User
Super User

@Anonymous  try this

 

smpa01_0-1634315776597.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
smpa01
Super User
Super User

@Anonymous https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523#M607150

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

This is the sample table I have 😄 

 

CountryStore IDStore ClassEmployeesProductsTotal employees per country Total employees per country per store class
Luxembourg12A5Rice9850
Luxembourg12A5Beans9850
Luxembourg543B25Cucumber9825
Luxembourg543B25Rice9825
Luxembourg543B25Beans9825
Luxembourg4757A45Rice9850
Luxembourg4757A45Tomatoes9850
Luxembourg23C3Tomatoes983
Luxembourg23C3Beans983
Luxembourg23C3Chicken983
Luxembourg224D20Beans9820
Luxembourg224D20Pasta9820
Germany357A32Cucumber  
Germany357A32Rice  
Germany357A32Beans  
Germany2356A6Rice  
Germany2356A6Tomatoes  
Germany2356A6Chicken  
Germany2356A6Beans  
Germany9D8Rice  
Germany9D8Tomatoes  
Germany9D8Chicken  
Germany9D8Beans  
Germany9D8Cucumber  
Germany9D8Pasta  
Germany97B54Lemon  
Germany97B54Beans  
Germany97B54Cucumber  
France23C5Cucumber  
France23C5Beans  
France23C5Lemon  
France23C5Pasta  
France568A23Carrots  
France568A23Chicken  
France568A23Pasta  
France568A23Lemon  
France568A23Coriander  
France568A23Beans  
France67A9Chicken  
France67A9Pasta  
France67A9Carrots  
France3267D49Chicken  
France3267D49Pasta  
France3267D49Lemon  
France3267D49Coriander  
France3267D49Beans  
France111A27Chicken  
France111A27Pasta  
France111A27Lemon  

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors