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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
sandeepk66
Advocate I
Advocate I

Exclude Dimension for a Measure

Hi Geeks,

 

I m trying to Filter a Measure(Sum of SALES) based on caluclation on Dimesnions GROUPID='PHL' AND ITEM='1003'

Basically, Needs the below SQL condition in DAX:

 

SUM(CASE WHEN NOT([GROUPID]='PHL' AND [ITEM]='1003') THEN SALES END)

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

From what i understand, you wish to sum the sales after ignoring PHL from the GroupID column and 1003 from the Item column.  If my understanding is correct, then try this

 

=CALCULATE(SUM(Data[Sales]),Data[GroupID]<>"PHL",Data[Item]<>1003)

 

Please note that i have assumed the Item column to be a numeric column.  If not, then wrap 1003 in double quotes.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

From what i understand, you wish to sum the sales after ignoring PHL from the GroupID column and 1003 from the Item column.  If my understanding is correct, then try this

 

=CALCULATE(SUM(Data[Sales]),Data[GroupID]<>"PHL",Data[Item]<>1003)

 

Please note that i have assumed the Item column to be a numeric column.  If not, then wrap 1003 in double quotes.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
emadrigal
Helper II
Helper II

In power BI if you are using DAX you need to use calculation calculate formula for example:

 

calculate formula take and expression and a filter

Excluded Dimension = calculate(sum(sales), [GROUPID]="PHL" and [item]=1003)

emadrigal
Helper II
Helper II

if you are creating a measure with dax you need to use double quotes and use calculation for example:

 

 

excluded Dimension = calculate(sum(sales),[groupID]="PHL" and [item]="1003")

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.