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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
ttaa4455
Frequent Visitor

Measures

Hi,

 

I have the following 3 measures built:

  • Sales current year to date
  • sales last year to date
  • sale % change year to date

I added a column called "products "with the measures listed. I am having an issue where if the sales last year to date is negative and the sales current year to date is positive,

the sales % change measure is returning a negative number. That is inaccurate as we had more sales this year than last year. How can I fix that?

1 ACCEPTED SOLUTION

@ttaa4455 mathematic wise the result come out negative,  yes :). But if you want to do something else here then you could wrap it with an if and add a different calculation to this scenario.

Somthing like:

IF( AND([SALES] >= 0 , [SALES LAST YEAR] >= 0, [STANDARD Y/Y MEASURE], [SOMETHING ELSE])

2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

View solution in original post

4 REPLIES 4
SpartaBI
Community Champion
Community Champion

@ttaa4455 what result do you want to get for example?
This year: 10
Last year: -2
?

So let's say for

Product A we had the $500 in sales this year, but last year the sales was -400 (loss). 

The sales percent change should be positive right? Because we got sales this year but not last year. But when I put my measure for sales % change it's negative change. Shouldn't it be positive? 
I am dividing my sales this year by sales last year 

@ttaa4455 mathematic wise the result come out negative,  yes :). But if you want to do something else here then you could wrap it with an if and add a different calculation to this scenario.

Somthing like:

IF( AND([SALES] >= 0 , [SALES LAST YEAR] >= 0, [STANDARD Y/Y MEASURE], [SOMETHING ELSE])

2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

So it looks like this: Sales % Chg = Divide([Sales CYTD],[Sales LYTD)-1

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors