Forum Discussion
Bakhtawar
6 years agoPost Patron
dax formula
I have this formula in qliksense (
RangeMax(0,RangeMin(( POLICY_END_DATE-POLICY_EFFECTIVE_DATE+ 1),(Date(vPE_Date) - POLICY_EFFECTIVE_DATE +1)))
)
/
(POLICY_END_DATE-POLICY_EFFECTIVE_DATE+ 1) i a...
- 6 years ago
One of them will give you result. That qlik funtion gives min max out of two, Tried that
measure = var _d1 =(datediff( POLICY_END_DATE,POLICY_EFFECTIVE_DATE,day)+ 1) var _d2 = (datediff([vPE_Date].Date,POLICY_EFFECTIVE_DATE) +1) return divide(if(max(_d1) <max(_d2),max(_d1),max(_d2)),max(_d1))Or
measure = var _d1 =(datediff( POLICY_END_DATE,POLICY_EFFECTIVE_DATE,day)+ 1) var _d2 = (datediff([vPE_Date].Date,POLICY_EFFECTIVE_DATE) +1) return divide(if(sum(_d1) <sum(_d2),sum(_d1),sum(_d2)),sum(_d1))
Bakhtawar
6 years agoPost Patron
this part is related to earned days .. like how much days we earned .
RangeMax(0,RangeMin(( POLICY_END_DATE-POLICY_EFFECTIVE_DATE+ 1),(Date(vPE_Date) - POLICY_EFFECTIVE_DATE +1
and this part is realted to total days
POLICY_END_DATE-POLICY_EFFECTIVE_DATE+ 1.. amitchandak
Bakhtawar
6 years agoPost Patron
amitchandak Icey any help please
- amitchandak6 years agoSuper User
datediff is the function can you diff between two dates. Are these dates part the same table and same row. The create a new column. If not. If possible please share a sample pbix file after removing sensitive information.
https://docs.microsoft.com/en-us/dax/datediff-function-dax
Thanks.
My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970