Forum Discussion
Controlling Visual's default Content
Anonymous , Assume you are using Measure in Bar. In place of that use the below measure
if(isfiltered('Date'[Date]), [Measure], calculate([Measure], filter('Date', 'Date'[Date] =Today())))
Thanks for the instant update amit,
I am using T-SQL query in my model. Bar chart didnt use any measure and uses the field direclty.
Line chart uses count of employees (value) by date (year-> quarter- > month -Day) (Axis)
Bar chart uses count of employees (value) by location (Axis)
Please advise. Thanks.
- Anonymous4 years agoNot applicable
Based on your suggestion, I tried replacing the measure field by a calculation but it is not fully responding as expected. when it shows todays count (emp attendance) by default, it doesnt show the count passed by filtering from line chart per day. Please refer below the measure calculation and the report visuals and advise further.
EmpCnt = if( isfiltered(Table1[TIMEDATE]),
calculate(DISTINCTCOUNT(Table1[Empnumber]), filter(Table1, Date(Year(Table1[TIMEDATE]),Month(Table1[TIMEDATE]),Day (Table1[TIMEDATE])) =Today()))
,DISTINCTCOUNT(Table1[Empnumber]))In the above image, bar chart at the right, shows today's emp attendance count, with the above measure calculaton. But when clicked anywhere in the line chart, the corresponding values are not shown/filtered in the bar chart. Thus the bar chart value remains with today's value ever.
Please note that all the 3 visuals are set to filter/highlight interactions between each other and suggest if the anything is missing in this approach.
Thanks
- v-kkf-msft4 years agoCommunity Support
Hi Anonymous ,
Please try the following formula:
measure = IF ( HASONEVALUE ( Table1[TIMEDATE] ), DISTINCTCOUNT ( Table1[Empnumber] ), CALCULATE ( DISTINCTCOUNT ( Table1[Empnumber] ), FILTER ( Table1, Date ( Year ( Table1[TIMEDATE] ), Month ( Table1[TIMEDATE] ), Day ( Table1[TIMEDATE] ) ) = Today () ) ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
Hi Winniz,
Thank you so much for taking time to respond my issue.
Due to deadlines, I was forced to apply a workaround with set of butttons (Today/Other days), bookmarks I was able to show the data correspondingly.
Anyway, I tried applying the formula you have provided, bar chart at the right showed the current date value initially but it displayed nothing when any of the data point is selected in the line chart. Thanks Anyway.