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.
Hi,
I am comapring last year products with this years products. I have used the below dax code, i filter on the year as we use an accounting week. My problem is we have some old products in 2016 that we do not sell in 2017, The Percentage then is 100%. what should i do to only compare products sold in both this year and last.
Year on Year = if(CALCULATE([PPK],Query1[Year]=2016),[PPK]-CALCULATE([PPK],Query1[Year]=2017),[PPK])
@Kbrennan856 wrote:
Hi,
I am comapring last year products with this years products. I have used the below dax code, i filter on the year as we use an accounting week. My problem is we have some old products in 2016 that we do not sell in 2017, The Percentage then is 100%. what should i do to only compare products sold in both this year and last.
Year on Year = if(CALCULATE([PPK],Query1[Year]=2016),[PPK]-CALCULATE([PPK],Query1[Year]=2017),[PPK])
How you calculate the percentage? Maybe you can use IF statement, when the last year sales is blank return blank instead.
IF(ISBLANK([lastyearsales]),BLANK(),[yourPrecDax])
Perhaps have a product table where you do a COUNT for 2017 and 2016 and if the COUNT for 2016 comes back 0, flag that as FALSE, otherwise TRUE. Then you could filter your measure to just TRUE values.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |