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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Spotlamp
Frequent Visitor

Dynamic drop down from measure with data from one table

I think this should be a simple problem but I've spent about 5 hours on it and still haven't solved it.

 

I'd like to create a dynamic drop down list based on data from a slicer.  The concept is that if you select only 1 "office" (the orange list), the blue drop down list should contain the custom meeting names for that office.  However, if you select none, or multiple offices, the blue drop down list should contain the standard meeting names.

 

This then needs to be able to filter the main table in white to show only the relevant values that would be selected from the blue drop down.

 

I managed to create a measure that counts how many offices have been selected in the orange box but I was unable to figure out how to use it to filter the main table.  When I added it as a column I didn't get the results I was expecting.  The formula for the measure that counts the items selected is: 

One Office Selected = IF(IF(ISFILTERED(Meetings[office]),COUNTROWS(VALUES(Meetings[office])),0)=1,1,0)

 

Spotlamp_0-1717742721133.png

Any help would be greatly appreciated, I'm losing my marbles with this one.

Many thanks

H

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Spotlamp 

 

One method I would suggest is to use a field parameter that contains the standard/custom columns.

You can then create a measure can determine whether standard/custom should be selected and then apply a filter based on this measure to the 2nd slicer.

 

I have attached a sample PBIX, and these are the steps I followed:

 

1. Create a field parameter containing standard/custom columns:

 

Meeting Name Parameter = 
{
    ( "standard", NAMEOF ( 'Meetings'[standard] ), 0),
    ( "custom", NAMEOF ( 'Meetings'[custom] ), 1)
}

 

 

2. Create a measure Meeting Name Parameter Flag which returns 1 if the currently filtered Meeting Name Parameter should be used, otherwise 0. This is based on the condition HASONEVALUE ( Meetings[office] ):

 

Meeting Name Parameter Flag = 
VAR CurrentParameter =
    MAX ( 'Meeting Name Parameter'[Meeting Name Parameter] ) -- can't use SELECTEDVALUE
VAR FlagBoolean =
    IF (
        HASONEVALUE ( Meetings[office] ),
        CurrentParameter = "custom",
        CurrentParameter = "standard"
    )
VAR FlagInteger =
    INT ( FlagBoolean )
RETURN
    FlagInteger

 

 

3. Place the field parameter on the 2nd slicer, set the slicer to "Show values of selected field" and Apply a Top 1 filter to 'Meeting Name Parameter'[Meeting Name Parameter]:

OwenAuger_0-1717753992145.png

4. Now the 2nd slicer field changes based on whether 1 or more values are filtered on the 1st slicer:

OwenAuger_1-1717754081648.png

OwenAuger_2-1717756341836.png

Does something like this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

5 REPLIES 5
Spotlamp
Frequent Visitor

This would be a sample of data from the survey table - linked to the meetings table on id.  I couldn't figure out how to upload a .pbix.

 

idquestionresponse

1Did the meeting start on time1
1Were minutes taken1
1Were actions created0.5
1Was their a call for recognition0.5
2Did the meeting start on time1
2Were minutes taken0.5
2Were actions created1
2Was their a call for recognition0.5
3Did the meeting start on time0.5
3Were minutes taken0
3Were actions created0
3Was their a call for recognition0.5
4Did the meeting start on time0.5
4Were minutes taken1
4Were actions created0.5
4Was their a call for recognition0.5
5Did the meeting start on time0.5
5Were minutes taken1
5Were actions created1
5Was their a call for recognition0.5
6Did the meeting start on time1
6Were minutes taken0.5
6Were actions created0.5
6Was their a call for recognition1
7Did the meeting start on time0
7Were minutes taken0.5
7Were actions created0
7Was their a call for recognition0
8Did the meeting start on time1
8Were minutes taken0
8Were actions created1
8Was their a call for recognition1
9Did the meeting start on time0.5
9Were minutes taken0.5
9Were actions created0.5
9Was their a call for recognition0.5
10Did the meeting start on time0.5
10Were minutes taken1
10Were actions created0.5
10Was their a call for recognition0
11Did the meeting start on time1
11Were minutes taken0.5
11Were actions created0.5
11Was their a call for recognition0.5
12Did the meeting start on time0
12Were minutes taken0
12Were actions created1
12Was their a call for recognition0.5
13Did the meeting start on time0
13Were minutes taken0
13Were actions created1
13Was their a call for recognition0.5
14Did the meeting start on time1
14Were minutes taken0.5
14Were actions created0.5
14Was their a call for recognition1
15Did the meeting start on time0
15Were minutes taken1
15Were actions created1
15Was their a call for recognition1
16Did the meeting start on time1
16Were minutes taken0
16Were actions created0.5
16Was their a call for recognition0
17Did the meeting start on time0.5
17Were minutes taken0.5
17Were actions created1
17Was their a call for recognition0.5
18Did the meeting start on time0.5
18Were minutes taken0.5
18Were actions created0
18Was their a call for recognition1
19Did the meeting start on time0.5
19Were minutes taken0
19Were actions created0.5
19Was their a call for recognition0.5
20Did the meeting start on time0.5
20Were minutes taken0.5
20Were actions created0
20Was their a call for recognition0.5
Spotlamp
Frequent Visitor

Thank you @OwenAuger, the solution works perfectly!  I haven't used parameter fields before so will do some research and learning.

 

The solution has enabled me to create the custom drop down which is what I asked for.  The follow up issue is that I had hoped I would be able to use it in a matrix as column headers, but it seems that's not possible.  The problem I've been asked to solve is to report on survey responses per meeting.  But different offices have different meeting names, but the same survey for each "standard" meeting type.  Therefore if you were the office manager, you could see your personal meeting names across the top of the matrix, but if you selected more than one office it would revert to the standard names across all offices.  Not sure if that's possible to solve, but I think this is a good compromise for now.

 

Many thanks

H

Hi @Spotlamp 

Glad that worked for you 🙂

 

You can also use the same field parameter in matrix columns (or anywhere else in a visual that expects a column), with the same "Top N" filter applied to the relevant visual.

(This works as long as there aren't other Top N filters on the same visual. Otherwise you can use a similar method with the Preselected Slicer custom visual providing the field parameter filter).

 

I have attached the PBIX with Page 2 showing an example in Matrix column headers.

 

Does this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Thanks @OwenAuger  - that worked perfectly.  I tried it before posting and it wouldn't let me drop the field parameter into the columns area.  Worked second time, must have used the measure and not the parameter.

 

Thanks for your support and guidance - I've managed to give the customer exactly what they were looking for.

 

Many thanks

H

OwenAuger
Super User
Super User

Hi @Spotlamp 

 

One method I would suggest is to use a field parameter that contains the standard/custom columns.

You can then create a measure can determine whether standard/custom should be selected and then apply a filter based on this measure to the 2nd slicer.

 

I have attached a sample PBIX, and these are the steps I followed:

 

1. Create a field parameter containing standard/custom columns:

 

Meeting Name Parameter = 
{
    ( "standard", NAMEOF ( 'Meetings'[standard] ), 0),
    ( "custom", NAMEOF ( 'Meetings'[custom] ), 1)
}

 

 

2. Create a measure Meeting Name Parameter Flag which returns 1 if the currently filtered Meeting Name Parameter should be used, otherwise 0. This is based on the condition HASONEVALUE ( Meetings[office] ):

 

Meeting Name Parameter Flag = 
VAR CurrentParameter =
    MAX ( 'Meeting Name Parameter'[Meeting Name Parameter] ) -- can't use SELECTEDVALUE
VAR FlagBoolean =
    IF (
        HASONEVALUE ( Meetings[office] ),
        CurrentParameter = "custom",
        CurrentParameter = "standard"
    )
VAR FlagInteger =
    INT ( FlagBoolean )
RETURN
    FlagInteger

 

 

3. Place the field parameter on the 2nd slicer, set the slicer to "Show values of selected field" and Apply a Top 1 filter to 'Meeting Name Parameter'[Meeting Name Parameter]:

OwenAuger_0-1717753992145.png

4. Now the 2nd slicer field changes based on whether 1 or more values are filtered on the 1st slicer:

OwenAuger_1-1717754081648.png

OwenAuger_2-1717756341836.png

Does something like this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.