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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Conditionally Negative Numbers Based on Another Table

Hi everyone!

 

I have a column with prices, and another column and another table with the acronyms C and D. That are Credit or Debit.

Tables are linked by a unique ID between them.

I need to turn prices to negative, when the acronym is D.

I am using SQL Server Analysis Services Tabular, how could I do this with DAX?

 

SSAS Problem.png

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi ralsouza,

 

Create a calculate column in table Toyota - Valores using DAX below:

Conditional Prices =
IF (
    RELATED ( 'Toyota - Lancamentos'[tipolancto] ) = "D",
    - [Valor Toyota],
    [Valor Toyota]
)

Regards,

Jimmy Tao

 

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi ralsouza,

 

Create a calculate column in table Toyota - Valores using DAX below:

Conditional Prices =
IF (
    RELATED ( 'Toyota - Lancamentos'[tipolancto] ) = "D",
    - [Valor Toyota],
    [Valor Toyota]
)

Regards,

Jimmy Tao

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors