Forum Discussion
NawilatiMahmoud
3 years agoFrequent Visitor
How To Write a New Measure to Split/divide/distribute a value when it filtered by Date ' Date Table
Dear Team, I need help in Writing a New Measure to Split/divide/distribute the member premium when it filtered by Date ' Date Table, the issues is when i filter by the date table it calculte the...
- 3 years ago
NawilatiMahmoud , refer if this can help
Measure way
Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM
https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785
v-zhangti
Community Support
3 years agoHi, NawilatiMahmoud
You can try the following methods.
Column:
Total =
CALCULATE ( SUM ( 'Table'[Member Premium] ),
ALLEXCEPT ( 'Table',
'Table'[Member Effective Date],
'Table'[Member Ineffective Date]
)
)
Measure:
Maxdate = IF(MAX('Date'[Date])<=SELECTEDVALUE('Table'[Member Ineffective Date]),MAX('Date'[Date]),SELECTEDVALUE('Table'[Member Ineffective Date]))Mindate = IF(MIN('Date'[Date])<=SELECTEDVALUE('Table'[Member Effective Date]),SELECTEDVALUE('Table'[Member Effective Date]),MIN('Date'[Date]))Measure =
Var _datediff=DATEDIFF([Mindate],[Maxdate],DAY)
Return
DIVIDE(SUM('Table'[Total]),_datediff)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- NawilatiMahmoud3 years agoFrequent Visitor
Thank you dear, but the below solution was easier for me, thank you for your reply and support