Forum Discussion
Dynamic calculation based on slicer value
- 6 years ago
Hi nixonyx ,
I have adjusted your PBIX. See the attached file.
For your WISH LIST,
1. only show events on the 'Expected' chart starting within 30 mins of selected event;
- Create a EventID Table without any relationship among other tables.
EventID Table = VALUES('sample'[EventID])- Create a measure.
Adjust ExpAttendees = IF ( ( MAX ( 'sample'[EventStart] ) >= ( [CurrentEventStart+AjustTime] - 30 / ( 24 * 60 ) ) ) && ( MAX ( 'sample'[EventStart] ) <= ( [CurrentEventStart+AjustTime] + 30 / ( 24 * 60 ) ) ), MAX ( 'sample'[ExpAttendees] ) )2. change the ExpSetUpTime, ExpReadyTime, EventStart by 'Adjust event start time' selected value and display the new values (e.g. in a card);
- Create Measures.
Selected EventID = SELECTEDVALUE('EventID Table'[EventID])Selected EventDate = CALCULATE ( MAX ( 'sample'[EventDate] ), FILTER ( ALL ( 'sample' ), 'sample'[EventID] = [Selected EventID] ) )SelectedThemeID = CALCULATE ( MAX ( 'sample'[EventThemeID] ), FILTER ( ALL ( 'sample' ), 'sample'[EventID] = [Selected EventID] ) )Selected EventSubThemeID = CALCULATE ( MAX ( 'sample'[EventSubThemeID] ), FILTER ( ALL ( 'sample' ), 'sample'[EventID] = [Selected EventID] ) )SelectedLocalID = CALCULATE ( MAX ( 'sample'[LocationID] ), FILTER ( ALL ( 'sample' ), 'sample'[EventID] = [Selected EventID] ) )Selected ExpSetUpTime = CALCULATE ( MAX ( 'sample'[ExpSetUpTime] ), FILTER ( ALL ( 'sample' ), 'sample'[EventID] = [Selected EventID] ) )Selected ExpReadyTime = CALCULATE ( MAX ( 'sample'[ExpReadyTime] ), FILTER ( ALL ( 'sample' ), 'sample'[EventID] = [Selected EventID] ) )Selected EventStart = CALCULATE ( MAX ( 'sample'[EventStart] ), FILTER ( ALL ( 'sample' ), 'sample'[EventID] = [Selected EventID] ) )3. only show events on the 'Adjusted' chart starting within 30 mins of adjusted event start time for the selected event.
What's the difference between 1 and 3? Sorry, I can't understand it well.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Icey
I have one more request, if I may.
I'm struggling to get the chart to work as expected. It seems to require me to add filters (date and locationID) to the filter panel or else it just shows the attendee presentation profile for all events on all dates.
I need the chart to show the attendee profile for all events within 30 minutes of the start time on the date selected and at the same location the event is taking place at.
Thank you very much for your help.