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
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
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.