cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Exclude Dimension for a Measure

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
Highlighted
Helper II
Helper II

Re: Exclude Dimension for a Measure

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")

Highlighted
Helper II
Helper II

Re: Exclude Dimension for a Measure

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)

Highlighted
Super User IV
Super User IV

Re: Exclude Dimension for a Measure

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

Helpful resources

Announcements
Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Kudoed Authors