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 All...
i have one logic need to impliment.
1. I have snapshot date column
2. Need employee count like month wise for the last 13 monnths
3. Have weight values 0.5 and 1
4. max and Min snapshot date*0.5 and remaing all months*1
5. total headcount(sum(Total Head count*Weight))
6. Avg headcount(Total headcount/ last12 months)
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1)My test data is the same as yours.
(2) We can create calculated columns.
Weight =
var _min=CALCULATE(MIN('Table'[SnapsjptDate]),ALL('Table'))
var _max=CALCULATE(MAX('Table'[SnapsjptDate]),ALL('Table'))
return IF('Table'[SnapsjptDate]=_min || 'Table'[SnapsjptDate]=_max,0.5,1)
Total Headcount * Weight = 'Table'[Count]* 'Table'[Weight]
(3)We can create measures.
Total Headcount = SUMX(ALL('Table'),'Table'[Total Headcount * Weight])
Avg Headcount = DIVIDE([Total Headcount],12,0)
(4) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1)My test data is the same as yours.
(2) We can create calculated columns.
Weight =
var _min=CALCULATE(MIN('Table'[SnapsjptDate]),ALL('Table'))
var _max=CALCULATE(MAX('Table'[SnapsjptDate]),ALL('Table'))
return IF('Table'[SnapsjptDate]=_min || 'Table'[SnapsjptDate]=_max,0.5,1)
Total Headcount * Weight = 'Table'[Count]* 'Table'[Weight]
(3)We can create measures.
Total Headcount = SUMX(ALL('Table'),'Table'[Total Headcount * Weight])
Avg Headcount = DIVIDE([Total Headcount],12,0)
(4) Then the result is as follows.
Best Regards,
Neeko Tang
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 |
---|---|
109 | |
108 | |
88 | |
75 | |
66 |
User | Count |
---|---|
125 | |
114 | |
98 | |
81 | |
73 |