Forum Discussion
Getting Average based on Latest entry
Try, Some thing like
Total = Calculate(
sumx(
SUMMARIZE(
data,
data[company],
data[geography],
"_Min",
minx( filter(data,data[Deal Size(min)]>0,data[date])),
"_Max"
minx( filter(data,data[Deal Size(max)]>0,data[date])),
"_comp"
max(data[company]),
"_geo"
max(data[geography])
),
calculate(
divide(_Min+_Max,(if(isblank(_Max),0,1)+if(isblank(_Min),0,1)))
)
)Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners/ba-p/890814
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
- rjsidek6 years agoHelper II
Hi amitchandak
Have tried implementing the code you suggested, but I got an error. Below is a screenshot:
Any ideas on how to rectify this?
- amitchandak6 years agoSuper User
put _min and _max in [ ]
- rjsidek6 years agoHelper II
Hi amitchandak
Is this for the bottom line after the "Divide" function? I put them in [ ] like so
divide([_Min]+[_Max],(if(isblank[_Max]),0,1)+if(isblank([_Min]),0,1)))but am still receiving the same errors