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 have trouble to create a measure that only calculates a value for the last month within a selected time period (not necessarily the current month..), the rest of the months in the selected period should be zero. The last filter is not working, Anyone ideas? Many thanks in advance!
Hi,
Share some data, describe the question and show the expected result. Your chances of getting a good solution become a lot more brighter when you describe your question rather than just post a formula.
Hi @WdeVries ,
According to your description, I create this data:
Here are the steps you can follow:
1. If the function behind Return has no specific meaning, you can directly return PART
Measure =
var _DayOfMonth=DATEDIFF(
EOMONTH(MAX('Table'[date]),-1),
MAX('Table'[date]),DAY)
VAR _DaysInMonth = datediff(
EOMONTH(MAX('Table'[date]),-1),
EOMONTH(MAX('Table'[date]), 0), DAY)
VAR _PART = Divide(
_DayOfMonth,
_DaysInMonth,
BLANK()
)
return
_PART
2. Result:
You can downloaded PBIX file from here
If the result is still incorrect, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try using ALLSELECTED instead of ALL In the Last Line and let me know!
Proud to be a Super User!
Hi VijayP,
Thank you for the quick reply, ALLSELECTED gives the same result.
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 |
---|---|
100 | |
99 | |
76 | |
66 | |
59 |
User | Count |
---|---|
142 | |
106 | |
103 | |
85 | |
70 |