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 There,
I have created 3 measures as below
1) Headcount = SUM(Employee_Data[No of Employee])
2) PreviousMonthHeadcount = CALCULATE([Headcount],PREVIOUSMONTH(Date_Table[Date]))
3) 2MonthsAvgHeadcount = DIVIDE([Headcount]+[PreviousMonthHeadcount],2,0)
Click here to get sample power bi file
Now, I have to calucate YTD headcount using '2MonthsAvgHeadcount' measure
Solved! Go to Solution.
Hi @AshokThakur ,
Assuming the Date_Table is a calendar table, you may create measure like DAX below.
YTD of 2MonthsAvgHeadcount= TOTALYTD(SUMX(Employee_Data, [2MonthsAvgHeadcount]), Date_Table[Date])
Or
YTD of 2MonthsAvgHeadcount= CALCULATE(SUMX(Employee_Data, [2MonthsAvgHeadcount]),FILTER(ALLSELECTED(Employee_Data), Employee_Data[MonthYear]<=MAX(Employee_Data[MonthYear])))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AshokThakur ,
Assuming the Date_Table is a calendar table, you may create measure like DAX below.
YTD of 2MonthsAvgHeadcount= TOTALYTD(SUMX(Employee_Data, [2MonthsAvgHeadcount]), Date_Table[Date])
Or
YTD of 2MonthsAvgHeadcount= CALCULATE(SUMX(Employee_Data, [2MonthsAvgHeadcount]),FILTER(ALLSELECTED(Employee_Data), Employee_Data[MonthYear]<=MAX(Employee_Data[MonthYear])))
Best Regards,
Amy
If this post helps, then please consider Accept 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 |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |