Forum Discussion
Earliest Function
Hi,
We are trying to create a measure based on calculated column, need help on the approach. Below the data like in Power Bi table. Where Date is the slicer.
| Date | ID | Percentage |
| 8/30/2021 | 1234 | 59.13% |
| 8/30/2021 | 1234 | 59.13% |
| 8/30/2021 | 1234 | 59.13% |
| 8/30/2021 | 1234 | 59.13% |
| 9/6/2021 | 5698 | 14.22% |
| 9/6/2021 | 5698 | 14.22% |
| 9/6/2021 | 5698 | 14.22% |
| 9/13/2021 | 1485 | 11% |
| 9/13/2021 | 1485 | 11% |
| 9/13/2021 | 1485 | 11% |
| 9/20/2021 | 26987 | 44.23% |
| 9/20/2021 | 26987 | 44.23% |
| 9/20/2021 | 26987 | 44.23% |
| 9/20/2021 | 26987 | 44.23% |
| 9/20/2021 | 26987 | 44.23% |
We are trying to get (If we select date between 8/30/2021 and 9/6/2021) then sum(59.13%+14.22%)/2 (distinct ID)
and if we select date range between 8/30/2021 and 9/20/2021 then sum(59.13%+14.22%+11%+44.23%)/4 (distinct ID)
and if we select date range between 9/15/2021 and 9/25/2021 then sum(44.23%)/1 (distinct ID)
Anonymous try this measure:
DIVIDE ( SUMX ( VALUES ( Table[Id] ), CALCULATE ( MAX ( Table[Percentage] ) ) ), DISTINCTCOUNT ( Table[Id] ) )✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
1 Reply
- parry2kSuper User
Anonymous try this measure:
DIVIDE ( SUMX ( VALUES ( Table[Id] ), CALCULATE ( MAX ( Table[Percentage] ) ) ), DISTINCTCOUNT ( Table[Id] ) )✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡