Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I need to calculate someting like
plannedDayQty = CALCULATE(COUNTROWS(day);SEARCH("2";day[weekPlan];;0))
Solved! Go to Solution.
Hi @Giancarlo,
Try this one, please.
plannedDayQty = VAR selected = SELECTEDVALUE ( 'calendar'[DayOfWeekNumber] ) RETURN CALCULATE ( COUNTROWS ( day ); SEARCH ( selected; day[weekPlan];; 0 ) )
Best Regards,
Ciao Giancarlo
If understand correctly you have to make the "2" in the SEARCH dynamic?
If so create a table with your values, put that in a slicer and use SELECTEDVALUE(Yourtableslicer[column]) in place of the 2.
unless i haven't understood ...
Thanks but...
A 'SELECTEDVALUE' function was used in a True / False expression used as a table filter expression. This is not allowed.
I used
Hi @Giancarlo,
Try this one, please.
plannedDayQty = VAR selected = SELECTEDVALUE ( 'calendar'[DayOfWeekNumber] ) RETURN CALCULATE ( COUNTROWS ( day ); SEARCH ( selected; day[weekPlan];; 0 ) )
Best Regards,
User | Count |
---|---|
97 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
112 | |
96 | |
95 | |
67 | |
65 |