Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Power BI experts,
I am calculating the inflation impact based on this calculation logic.
(Monthly weighted average price in this year's month - Monthly weighted average price in previous year's month) * Quantity in this year's month *(-1)
The basic logic (Pattern A) is done as per the below, but I realized that there are exceptions since we don't have transactions every single month, such as patterns B and C.
Could someone help me with building dynamic DAX logic with this sample data? Big thank you in advance!
Sample data and detailed explanation:
This year's month | Last year's month | Action | |
Pattern A | Yes | Yes | Include |
Pattern B | No | Yes | Exclude |
Pattern C | Yes | No | Excule if there is no transaction all the way to 24 months ago. |
Inflation impact = |
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
27 | |
12 | |
11 | |
10 | |
6 |