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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
marru1982
Frequent Visitor

DAX

Hi ,

 

I have a column for Quarter which shows (Q1,Q2,Q3 , Q4 and "FY" rows , and have a separate column for Year 

need to show the below sales result  , when year= 2024 , then the sales value -1 , else Sales 

 

Have tried using IF ELSE but no help

 

Need help to solve this with DAX

4 REPLIES 4
Anonymous
Not applicable

Hi, @marru1982 

I create a sample table:

vyohuamsft_0-1721028500306.png

Then create a calculated column and use the following dax:

NewSalesColumn = 
IF (
    'Table'[Year] = 2024,
    'Table'[Sales] - 1,
    'Table'[Sales]
)

Here is my preview:

vyohuamsft_1-1721028569073.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thanks @Anonymous  but in Quarter , there is another row for "FY " and need to use that to show sum of all quarter

rajendraongole1
Super User
Super User

Hi @marru1982 - you can try below calculation to get the expected result using if clause

 

Modified Sales Value =
IF(
[Year] = 2024 && [Quarter] <> "FY",
[Sales] - 1,
[Sales]
)

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





fahadqadir3
Super User
Super User

@marru1982 There is no screenshot attached,If you need to work within a specific context, like a visual that filters by quarters or years, make sure your measure or calculated column is designed accordingly.

If you want to create a new column in your table:

AdjustedSales = 
IF(
[Year] = 2024,
[Sales] - 1,
[Sales]
)

If you want to create a measure to use in your visuals:

 AdjustedSales = 
IF(
SELECTEDVALUE('Table'[Year]) = 2024,
SUM('Table'[Sales]) - 1,
SUM('Table'[Sales])
)

 @marru1982  Hope it works.

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!! 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.