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
JozefR
New Member

Set field parameter value based on filtering of another slicer

Hello,

 

I was wondering if it's possible to set value in Field parameter based on filtering of another slicer. My report is based on following table (example):

 

DepartmentBusiness_keyPlan
AdminAD140
AdminAD220
AdminAD330
FinanceFI150
FinanceFI210
ITIT130
ITIT220
ITIT340
ITIT480
ITIT560

 

I created a new filed parameter which contains two fields: Department and Business_key and I also added new slicer based od this parameter to the page. Then I created a new pie chart which contains Parameter as Legend and Plan as Value.

I also added a new slicer based on the Department field  - I need this slicer for filtering some other visuals on this page. Everything works fine so far and my report looks like this:

 

JozefR_0-1665131748356.png

 

My scenario is: IF(ISFILTERED('Hárok1'[Department]; Parameter[Parameter] = Business_key; Parameter[Parameter] = Department)

 

I realize of course that the formula above is wrong but I would like to say: if Department slicer is filtered, show me values filtering by Business Key, otherwise by Department in pie chart.

 

Thanks.

3 REPLIES 3
HassanAshas
Helper V
Helper V

Has anybody found a solution to this problem? 

JozefR
New Member

Hi Jianbo Li,

 

thanks for the reply but it doesn't match my scenario. You replaced my Department slicer with new "Value" slicer changing based on Attribute slicer , but as i mentioned above, I need Department slicer unchanged with only departments values becasue this slicer is used to filter other visuals on this page (I didn't show them in my example).

 

Regards

JozefR

v-jianboli-msft
Community Support
Community Support

Hi @JozefR ,

 

You can achieve your goal by using Unpivot in Power Query.

Please try:

vjianbolimsft_1-1665368307890.png

Here is the M code:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckzJzcxT0lFydDEEkiYGSrE6yIJGQNIIXdAYSBpDBN0y8xLzklOBAm6eIANMMYVBRhhChD1DgGzPEEOEfqgIkjVQEWOEa6AiJkDSAkXEFEiaAUViAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Department = _t, Business_key = _t, Plan = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Department", type text}, {"Business_key", type text}, {"Plan", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Plan"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

Then create visuals:

Create a slicer for Attribute:

vjianbolimsft_2-1665368417591.png

Turn on the single select option:

vjianbolimsft_3-1665368490955.png

Then create a slicer for value:

vjianbolimsft_4-1665368526862.png

Create a Pie chart:

vjianbolimsft_5-1665368564980.png

Final output:

vjianbolimsft_6-1665368593968.png

vjianbolimsft_7-1665368608526.png

Best Regards, 

Jianbo Li 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

 

 

 

 

 

 

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.