Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
User | Count |
---|---|
99 | |
86 | |
80 | |
76 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |