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

Dynamic Table Columns With Slicer Using Field Parameters

Hi,

I have a table visual that is controlled by slicer and both table & slicer are using field parameters. It’s working fine but I would like to modify the slicer. The slicer currently has 9 values:

  • Kiosk Revenue
  • Kiosk Comparative
  • Kiosk Variance
  • TEX Revenue
  • TEX Comparative
  • TEX Variance
  • Online Revenue
  • Online Revenue Comparative
  • Online Revenue Variance

I would like to reduce it by grouping the values into 3 categories:

  • Kiosk
  • TEX
  • Online Revenue

So based on the above changes, the operation will be the same i.e.

  • when “Kiosk” is selected, the columns “Kiosk Revenue”, “Kiosk Comparative”, and “Kiosk Variance” will show on the table

  • when “TEX” is selected, the columns “TEX Revenue”, “TEX Comparative”, and “TEX Variance” will show on the table

  • when “Online Revenue” is selected, the columns “Online Revenue”, “Online Revenue Comparative”, and “Online Revenue Variance” will show on the table

  • when no values selected, all columns will show on the table

Is this possible to achieve? Hope that makes sense. @d_gosbell appreciate any help please.

 

Pbix file for reference
https://drive.google.com/file/d/1EEW1KK33DArAHRH34VqZNjNk6KqJPaFM/view?usp=sharing

 

Short clip of the issue

https://www.awesomescreenshot.com/video/11722864?key=8ccea0351155f9c35870e85bd501f45b

 

qsmith83_0-1665873875166.png

 

1 ACCEPTED SOLUTION


@Anonymous wrote:

Hi @d_gosbell and @Shaurya , thanks for the feedback. That works but this is not the result I'm looking for. I need the columns to appear when value in slicer is selected and if no values selected, then columns are hidden.


This is my solution working the way you've described. I've put a revenue and comparative measure in the values and created a slicer for the category

 

slicer.gif

View solution in original post

5 REPLIES 5
d_gosbell
Super User
Super User

I don't think you even need a field parameter to solve this.

 

If you create a table with your 3 values (I just called it category)

 
Category = DATATABLE("Category", STRING, {{"Kiosk"},{"TEX"},{"Online"}})
 
Then as @Shaurya suggested you can create measures checking for the selected value in the slicer (I would make the slicer a single selection). This is an example revenue measure, you would repeat the same pattern for Comparative and Variance.
 
Revenue = SWITCH( SELECTEDVALUE(Category[Category]),
    "Kiosk", 'Vend_Sale'[Revenue SUMX],
    "TEX",'mm_sheets'[Current Year Pax SUMX],
    "Online", 'Vend_Sale'[Transaction Count SUMX],
    blank())
 
Anonymous
Not applicable

Hi @d_gosbell and @Shaurya , thanks for the feedback. That works but this is not the result I'm looking for. I need the columns to appear when value in slicer is selected and if no values selected, then columns are hidden. Hence the field paramter method I chose.

 

Can I use integrate your method using the field parameters? I'll have a go but please do let me know if you find a quicker method. Thanks. 


@Anonymous wrote:

Hi @d_gosbell and @Shaurya , thanks for the feedback. That works but this is not the result I'm looking for. I need the columns to appear when value in slicer is selected and if no values selected, then columns are hidden.


This is my solution working the way you've described. I've put a revenue and comparative measure in the values and created a slicer for the category

 

slicer.gif

Anonymous
Not applicable

@d_gosbell , don't know what I did wrong the first time, but it's working for me now...without the need for field parameters. 

 

Many thanks for your help and patience. Appreicate it.

Shaurya
Memorable Member
Memorable Member

Hi @Anonymous,

 

Create a new category column that has values Kiosk, TEX and Online Revenue and use that for your slicer. Check the measure created for your field parameter and modify it accordingly.

 

Did I answer your question? Mark this post as a solution if I did!
Consider taking a look at my blog: Forecast Period - Previous Forecasts

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.

Top Solution Authors