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 want to calculate a measure for the latest selected month e.g. if user selects a range between Jan to Nov, measure will be calculated for Nov. If user selects May to Jun, measure will be calculated for Jun.
Only other condition is that future weeks are always excluded.
I've gotten it using the below code but wondering if there's an easier and more optimized way of achieving the same.
MEASURE Metrics[All FTE (Latest Month)]=
VAR LatestMonthRollingNo = CALCULATE(MAX(WorkDateCalendar[Rolling Month No]), WorkDateCalendar[Rolling Week No] < 1)
RETURN
CALCULATE([All FTE], WorkDateCalendar[Rolling Month No] = LatestMonthRollingNo)
Hi vickyd,
Does the answer make sense? If it is, could you help mark the answer to finish the thread?
Regards,
Jimmy Tao
Hi vickyd,
So your requirement is to achieve the lastest selected month and calculate the value based on the lastest month, right? You may try measure below and check if it can meet your requirement.
Metrics[All FTE (Latest Month)] = VAR LatestMonthRollingNo = CALCULATE ( MAX ( WorkDateCalendar[Rolling Month No] ), ALLSELECTED ( WorkDateCalendar[Rolling Week No] ) ) RETURN CALCULATE ( [All FTE], WorkDateCalendar[Rolling Month No] = LatestMonthRollingNo )
Regards,
Jimmy Tao
Depending on how your model is set up, you may be able to use the DATESMTD function.
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |