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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Power BI - Don't show slicer with mandatory fields in dropdown menu.

Hi, everyone,

I have the following data selection:


1. SALES
2. DEMAND
3: FC1
4: FC2
5: FC3
...
n: FCn

 

The data "SALES" and "DEMAND" should be mandatory fields.
This means I only want to have the historical data "FC..." as a selection later in the slicer.

So i want to see this in my dropdown slicer:

1: FC1
2: FC2
3: FC3
...
n: FCn


However, I need the data "SALES" and "DEMAND" for the report.
But i can't just hide this data with the slicer.
I hope you understood me 🙂
Many Thanks
Flixy

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Its bit tricky part so have to handle it differently. Try to follow below steps:-

1. Create a seperate table for snapshots with below code:-

 

Snapshot_table = DISTINCT(FC_Data[Snapshot])

 

 

2. Now use newly created table in slicer.

Samarth_18_0-1643052821390.png

 

3. Now create a measure with below code:-

 

Measure =
IF (
    MAX ( FC_Data[Snapshot] )
        IN VALUES ( 'Snapshot_table'[Snapshot] )
            || MAX ( FC_Data[Snapshot] ) IN { "DEMAND", "SALES" },
    1,
    0
)

 

 

4. User new measure as filter on your bar chart:-

Samarth_18_1-1643052906917.png

 

output:-

Samarth_18_2-1643052943180.png

Note: Make sure you are not creating any relationship with existing table with new table.

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

8 REPLIES 8
v-eqin-msft
Community Support
Community Support

Hi  @Anonymous ,

 

@Samarth_18 's solution is effective. Could you share some screenshots to help us clarify your scenario since you mentioned it is not work on your side?

 

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,
Eyelyn Qin

Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Its bit tricky part so have to handle it differently. Try to follow below steps:-

1. Create a seperate table for snapshots with below code:-

 

Snapshot_table = DISTINCT(FC_Data[Snapshot])

 

 

2. Now use newly created table in slicer.

Samarth_18_0-1643052821390.png

 

3. Now create a measure with below code:-

 

Measure =
IF (
    MAX ( FC_Data[Snapshot] )
        IN VALUES ( 'Snapshot_table'[Snapshot] )
            || MAX ( FC_Data[Snapshot] ) IN { "DEMAND", "SALES" },
    1,
    0
)

 

 

4. User new measure as filter on your bar chart:-

Samarth_18_1-1643052906917.png

 

output:-

Samarth_18_2-1643052943180.png

Note: Make sure you are not creating any relationship with existing table with new table.

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Hi @Samarth_18 
thats not working in my Dashboard.
But thank you for the idea.

Anonymous
Not applicable

I want that the end user only can choose one "FC"-Snapshot.
The "Sales" and "Demand" should be automatically chosen.

So this is my database:

Flixyyyy_0-1643045209445.png

So i get this view:

Flixyyyy_1-1643045309737.png

But i only want to see one "FC".

If i filter now in the slicer without "Demand" and without "Sales" i get this:

Flixyyyy_2-1643045448829.png

Did you get my question? 😄

amitchandak
Super User
Super User

@Anonymous , is it a measure slicer?  Not very clear what you want.

 

With calculation group, you can get that multiselect and save with Demand and sales 

calculation groups
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/

Anonymous
Not applicable

This is what i get after the steps: @v-eqin-msft @Samarth_18 

Flixyyyy_0-1643891390801.png

 

@Anonymous I am hoping there is no relationship between these two tables?

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

@Samarth_18 i have created a relationship 😥
Now after delete the relationship its working 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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