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 would like to calculate the month difference between the selected date and min available date.
For example, the min date of this dataset is 2023-01, so MonthDiff is the expected result. How to create MonthDiff measure?
Month | MonthDiff |
2023-01 | 1 |
2023-02 | 2 |
2023-03 | 3 |
2023-04 | 4 |
2023-05 | 5 |
Solved! Go to Solution.
Hi @PBI_newuser
You can use this type of formula modified by your parameters:
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Is there a relationship between the DATES table and the Inventory table? If so, the problem is likely to be the filtering context being applied.
You could get around this problem using variables like in the DATEDIFF example linked below and using a CALCULATE statement and an ALL(DATES) i.e. var EndDate = CALCULATE(MAX(Inventory[Date]), ALL(DATES))
DATEDIFF function (DAX) - DAX | Microsoft Learn
Hi @PBI_newuser
You can use this type of formula modified by your parameters:
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
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 |
---|---|
107 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
143 | |
104 | |
104 | |
80 | |
66 |