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
MusaabYaqub
New Member

Unable to convert positive values to blank while negative to positive

Trying to convert negative values into positive and positive values as blank. Challenge is that the Total still considers the blank values. How to not have it consider the blank values? The calculated column option would be a good one but calculated column doesnt take a dax measure as input. 

For example, the RC Volume Difference total considers the 32.53 value and I converted it to 0 but still the total considers it. Dont know how to solve this problem.

 

MusaabYaqub_0-1709658509814.png

 

1 ACCEPTED SOLUTION
Daniel29195
Super User
Super User

@MusaabYaqub 

 

use this pattern in your measure : 

 

measure = 

var ds = 
addcolumns(
values(datetable[date]) , 
"rc vol diff" ,
switch(
true() , 
[your measure] < 0 , abs([mesaure]) , 
[your measure]>0 ,  [measure] * -1 ,
[your measure]
)

return 
sumx ( ds, [rc vol diff] ) 

 

let me know if this works for you . 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

View solution in original post

2 REPLIES 2
v-yaningy-msft
Community Support
Community Support

Hi, @MusaabYaqub 

 

Based on your description, I have created a measure and a new column to achieve the effect you are looking for. Following picture shows the effect of the display.

vyaningymsft_0-1709704045297.png

Measure:

New RC Volumn Difference1 =

CALCULATE ( MAX ( 'Table'[RC Volumn Difference] ) )

New Column:

New RC Volumn Difference =

VAR _selectedValue = 'Table'[New RC Volumn Difference1]

VAR _RCVolumnDifference =

    IF ( _selectedValue <= 0, ABS ( _selectedValue ), 0 )

RETURN

    _RCVolumnDifference


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

Daniel29195
Super User
Super User

@MusaabYaqub 

 

use this pattern in your measure : 

 

measure = 

var ds = 
addcolumns(
values(datetable[date]) , 
"rc vol diff" ,
switch(
true() , 
[your measure] < 0 , abs([mesaure]) , 
[your measure]>0 ,  [measure] * -1 ,
[your measure]
)

return 
sumx ( ds, [rc vol diff] ) 

 

let me know if this works for you . 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

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.