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
CleverUser23
Frequent Visitor

Creating a Measure with filters on both negative and positive values

Hi,

 

Hi I'm trying to build a measure that would sum all variations over or equal to 1M and under 10M or over -10M and under or equal to -1M.

 

In other words:

  • the number must be > -10,000,000 && <=-1,000,000
  • or, the number must be <10,000,000 && >=1,000,000

 

I've tried the following but it is not working:

 

Weekly Delta:=CALCULATE(sum('Table'[DeltaHebdoCAD]))

 

Weekly1M:=CALCULATE([Weekly Delta], FILTER('Table','Table'[DeltaHebdoCAD]<10000000 && 'Table'[DeltaHebdoCAD]>=1000000), FILTER('Table','Table'[DeltaHebdoCAD]>-10000000 && 'Table'[DeltaHebdoCAD]<=-1000000))

 

Thank you,

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Give this a try.

Weekly1M := CALCULATE(
	[Weekly Delta], 
	ABS('Table'[DeltaHebdoCAD]) < 10000000,
	ABS('Table'[DeltaHebdoCAD]) >= 1000000
)

View solution in original post

Anonymous
Not applicable

I'm not sure what you are asking.  The ABS function i've used is for an Absolute Value.  That means that both negative and positve numbers are counted as positive numbers.

 

 

If i understand you correctly, simply need a formula that is 

Net Position = ABS(SUM('Table'[DeltaHebdoCAD]))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Give this a try.

Weekly1M := CALCULATE(
	[Weekly Delta], 
	ABS('Table'[DeltaHebdoCAD]) < 10000000,
	ABS('Table'[DeltaHebdoCAD]) >= 1000000
)

Thank you for taking the time to awnser me Ross.

 

Your measure works, bu there is something I forgot to mention.

 

What if I needed to retain only net position of every group in my sum?

 

Let's say I have 3 groups, A B and C with the following numbers associated.

2018-09-20_14-31-27.png

 

  • A should not be retain because he's got a net position of 950k.
  • B should be retain because his position is -1200k.
  • C should be retain because hes got a net position of 1100k.

My ultimate goal is here is to show net position of groups that have a net position of less than 10M but over 1M (In absolute numbers).

 

Regards,

 

Anonymous
Not applicable

I'm not sure what you are asking.  The ABS function i've used is for an Absolute Value.  That means that both negative and positve numbers are counted as positive numbers.

 

 

If i understand you correctly, simply need a formula that is 

Net Position = ABS(SUM('Table'[DeltaHebdoCAD]))

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.