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.
I am trying to create a formula to find the monthly change in aggregated sales data. But I would like to exclude any data from the previous month that does not compare with the current products in production.
For example, Product A was dropped from production in the current month (1/31/2017). I'd like the formula to compare the monthly change in product B and C, and exclude Product A. The formula must recognize that Product A data was not included in the current period and filter it from the total monthly change.
Product | 12/31/2016 | 1/31/2017 | Monthly Change |
A | 100 | -100 | |
B | 200 | 250 | 50 |
C | 300 | 350 | 50 |
Could you please provide us some sample data, so that we can make further.
Generally, we can get previous month amount by using PREVIOUSMONTH function. It returns a table that contains a column of all dates from the previous month, based on the first date in the dates column, in the current context. Sample DAX expression.
=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), PREVIOUSMONTH('DateTime'[DateKey]))
Regards,
Charlie Liao
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |