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