Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
jimmyfromus
Helper III
Helper III

Table contains measures and not slicing as expected

Hi, 

 

I have a table visual that contains some measures. It has six columns, contact, company, last event, next event, pipeline phase and profit. 

Last event and next event are calculated measures. 

I created a slicer dropdown for contact but the contacts in the underlying table are also showing in the dropdown. What is the best way to get around this so only John and George would be shown in the contact slicer dropdown? Thanks for the support. 

 

51t.jpg

Here's the Table. 

 

ContactSessionEventParticipationStart dateGroupPipeline phaseProfitStatusCompany
John LLunchEvent 1Yes30.12.2020 00:00HYL-Commerce1-Qualify4000InvitedCompany 1
John LBreakfastEvent 2Yes31.12.2020 08:00HYL-Commerce1-Qualify4000InvitedCompany 1
John LEvening MealEvent 3No31.12.2020 08:00HYL-Commerce1-Qualify4000InvitedCompany 1
John LSupperEvent 4No29.11.2020 08:00HYL-Commerce1-Qualify4000InvitedCompany 1
John LBrunchEvent 5Yes29.11.2020 08:00HYL-Commerce1-Qualify4000InvitedCompany 1
GeorgeAfternoon teaEvent 6Yes27.06.2020 08:00 1-Qualify InvitedCompany 2
PaulMorning teaEvent 7No01.10.2020 08:00 1-Qualify InvitedCompany 3
RingoSnackEvent 8No03.12.2020 08:00   InvitedCompany 4

 

The measure for last Event is: 

Last event =
VAR _lastpdate =
CALCULATE (
MAX ( 'Table'[Start date] ),
FILTER (
ALL ( 'Table' ),
'Table'[Contact] = MAX ( 'Table'[Contact] )
&& 'Table'[Participation] = "Yes"
)
)
VAR _lastpevent =
CALCULATE (
MAX ( 'Table'[Session] ),
FILTER (
ALL ( 'Table' ),
'Table'[Contact] = MAX ( 'Table'[Contact] )
&& 'Table'[Participation] = "Yes"
&& 'Table'[Start date] = _lastpdate
)
)
RETURN
( _lastpevent )

 

Thanks. 

 

6 REPLIES 6
v-luwang-msft
Community Support
Community Support

Hi @jimmyfromus   ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution to help others find it.
 

Best Regard

Lucien Wang

v-luwang-msft
Community Support
Community Support

Hi @jimmyfromus ,

According to what you have mentioned,you want to filter for last event which is not blank, and the values wouldn't  be picked up where they are blank and get the value in the next event column, moreover you want just 3 people to appear in the dropdown, right?

If so, try the following measure:

 

Last event =

VAR _lastpdate =

CALCULATE (

MAX ( 'Table'[Start date] ),

FILTER (

ALL ( 'Table' ),

'Table'[Contact] = MAX ( 'Table'[Contact] )

&& 'Table'[Participation] = "Yes"

)

)

VAR _lastpevent =

CALCULATE (

MAX ( 'Table'[Session] ),

FILTER (

ALL ( 'Table' ),

'Table'[Contact] = MAX ( 'Table'[Contact] )

&& 'Table'[Participation] = "Yes"

&& 'Table'[Start date] = _lastpdate

)

)

RETURN

( _lastpevent )

 

 

Next event =

VAR _nextpdate =

CALCULATE (

MAX ( 'Table'[Start date] ),

FILTER (

ALL ( 'Table' ),

'Table'[Contact] = MAX ( 'Table'[Contact] )

&& 'Table'[Participation] = "No"  && 'Table'[Pipeline phase]<>BLANK()

)

)

VAR _nextpevent =

CALCULATE (

MAX ( 'Table'[Session] ),

FILTER (

ALL ( 'Table' ),

'Table'[Contact] = MAX ( 'Table'[Contact] )

&& 'Table'[Participation] = "No"

&& 'Table'[Start date] = _nextpdate &&'Table'[Pipeline phase]<>BLANK()

)

)

RETURN

( _nextpevent )

 

If  the value in Lastevent is blank ,then input the value in Nextevent column ,I create a measure  for finalevent is:

Final event =

VAR _lastpdate =

CALCULATE (

MAX ( 'Table'[Start date] ),

FILTER (

ALL ( 'Table' ),

'Table'[Contact] = MAX ( 'Table'[Contact] )

&& 'Table'[Participation] = "Yes"

)

)

VAR _lastpevent =

CALCULATE (

MAX ( 'Table'[Session] ),

FILTER (

ALL ( 'Table' ),

'Table'[Contact] = MAX ( 'Table'[Contact] )

&& 'Table'[Participation] = "Yes"

&& 'Table'[Start date] = _lastpdate

)

)

VAR _nextpdate =

CALCULATE (

MAX ( 'Table'[Start date] ),

FILTER (

ALL ( 'Table' ),

'Table'[Contact] = MAX ( 'Table'[Contact] )

&& 'Table'[Participation] = "No" && 'Table'[Pipeline phase]<>BLANK()

)

)

VAR _nextpevent =

CALCULATE (

MAX ( 'Table'[Session] ),

FILTER (

ALL ( 'Table' ),

'Table'[Contact] = MAX ( 'Table'[Contact] )

&& 'Table'[Participation] = "No"

&& 'Table'[Start date] = _nextpdate &&'Table'[Pipeline phase]<>BLANK()

)

)

Var finalevent=

IF(_lastpevent<>BLANK(), _lastpevent, _nextpevent)

 

RETURN

( finalevent)

 

Finally you will see:

v-luwang-msft_0-1611553947354.png

 

 

 

About the configuration of the slicer:

v-luwang-msft_1-1611553947357.png

 

 

 

You can take a look and if you have other questions, you are welcomed to continue to ask.

 

 

Best Regards,

Lucien

parry2k
Super User
Super User

@jimmyfromus you can create another measure with the logic and return 1 or 0 and use that measure in the filter.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I'm not too sure how to do that. Do I have to create a separate table for that?

parry2k
Super User
Super User

@jimmyfromus you can have a visual level filter on the slicer with one of the measure with condition where measure value is not blank

 

Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k Thanks, yeah that's correct. But I'm looking to exactly reflect the table in the dropdown. If for example, I filter for last event is not blank, then it wouldn't pick up the value where it's value is blank and there is a value in the next event column. I would like to have just 3 people to appear in the dropdown list as below, is that possible? Thank you again, I value the support. 

 

51u.jpg 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors