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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.