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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
sagdec12
Microsoft Employee
Microsoft Employee

How to sum up a measure based on different levels?

Hi everyone, I am facing a problem when sum up a measure on different levels.

 

I have Location table:

ProvinceCity
PA
PB

 

and product

Product
a
b

 

I have a already have a measure which calculates the cumulative sales, the result is similiar to:

CityProductJan 21Feb 21Mar 21Apr 21
Aa0244
Ab1223
Ba2234
Bb3344

 

now I want to count the number of products where the total value is greater than 4 based on product, which means

CityProductJan 21Feb 21Mar 21Apr 21
Aa0011
Ab0000
Ba0001
Bb0011

and I want the matrix can show on different levels, which means I can see on Province level:

ProvinceJan 21Feb 21Mar 21Apr 21
P0023

and also on City level

CityJan 21Feb 21Mar 21Apr 21
A0011
B0012

 

Because my cumulative sales is measure, the number is wrong when I go up to higher level.

Can anyone help me with it? Thank you very much!

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @sagdec12 ,

Could you pls share your pbix file ? And remember to remove confidential data.

 

Best Regards

Lucien

amitchandak
Super User
Super User

@sagdec12 , I think isinscope can help

example 

if(isinscope (Table[City]), [Meausre1], [Measure2])

 

refer

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.