Forum Discussion
VALUES function not working - using the resulting array of values works ok
Hi,
I am struggling with the VALUES function in the first part of the formula below. I am trying to get a list of unique DEAL_IDs where the Opportunity event happend in any given week (date filters applied via slicer), then use this list to filter the same table and count all event type for each DEAL_ID.
The aim is to get the below function working dynamically, using the VAR list instead of the array of strings:
----------------------------------------------------------------------------------------------------------------
VERSION 1
ALL(F_Events_Sequence),
VERSION 2
ALL(F_Events_Sequence),
- Anonymous4 years ago
Hi SBaher ,
Check the formula.
Measure = var _tmp1 = CALCULATETABLE(VALUES('Table'[Deal_ID]),FILTER(ALL('Table'),'Table'[EOW] = SELECTEDVALUE(slicer[EOW]))) var _tmp2 = CALCULATETABLE(VALUES('Table'[Event]),FILTER('Table','Table'[Deal_ID] in _tmp1)) return IF(SELECTEDVALUE('Table'[Event]) in _tmp2,1,BLANK())Pbix as attached.
Best Regards,
Jay
7 Replies
- DataInsightsSuper User
Will this work?
Weekly Ops = CALCULATE ( DISTINCTCOUNT ( F_Events_Sequence[DEAL_ID] ), ALL ( F_Events_Sequence ), [S_OPPORTUNITY_FLAG] = 1 ) - AnonymousNot applicable
Hi SBaher ,
Why using VALUES() function?
Check if the below formula works.
Measure = CALCULATE(DISTINCTCOUNT('Table'[id]),FILTER('Table',[_flag]=1))If you still want use VALUES() function, refer this formula.
Measure 2 =var _list = CALCULATETABLE(VALUES('Table'[id]),FILTER('Table',[_flag]=1))returnCALCULATE(DISTINCTCOUNT('Table'[id]),ALL('Table'),'Table'[id] in _list)Best Regards,Jay- SBaherRegular Visitor
Hi,
Thank you for looking into this, but unfortunately this still doesn't work in my case, hence it should not have been accepted as a solution.
Thanks,
- AnonymousNot applicable
Hi SBaher ,
Please show some sample data and expected result so that we could test the formula for you.
Best Regards,
Jay