This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowThe Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more
Hi,
I have the following 3 measures built:
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?
Solved! Go to 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])
@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])
So it looks like this: Sales % Chg = Divide([Sales CYTD],[Sales LYTD)-1
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
| User | Count |
|---|---|
| 24 | |
| 22 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 21 | |
| 20 | |
| 20 |