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.
I have a dataset in PowerBI I am creating a paginated report on via Report Builder. I want to filter the graph (which appears in a list) based on the Family Grouping in order to only show the relevant Local Authorities for the Family Grouping.
So far I have the following statement in the filter for the chart being evaluated as a boolean against true.
=Switch(Fields!Family_Grouping.Value="Environmental, Culture & Leisure, Economic Development, Corporate and Property",(Fields!Local_Authority.Value= "Stirling") OR (Fields!Local_Authority.Value= "Fife") OR (Fields!Local_Authority.Value= "Moray") OR (Fields!Local_Authority.Value= "North Ayrshire") OR (Fields!Local_Authority.Value= "East Lothian") OR (Fields!Local_Authority.Value= "East Ayrshire") OR (Fields!Local_Authority.Value= "Perth and Kinross") OR (Fields!Local_Authority.Value= "South Ayrshire") OR (Fields!Local_Authority.Value= "Scotland"),Fields!Family_Grouping.Value="Children, Social Work and Housing",(Fields!Local_Authority.Value= "Stirling") OR (Fields!Local_Authority.Value= "Scotland") OR (Fields!Local_Authority.Value= "Moray") OR (Fields!Local_Authority.Value= "East Lothian") OR (Fields!Local_Authority.Value= "Angus") OR (Fields!Local_Authority.Value= "Scottish Borders") OR (Fields!Local_Authority.Value= "Highland") OR (Fields!Local_Authority.Value= "Argyll & Bute") OR (Fields!Local_Authority.Value= "Midlothian"))
For some reason even if the family group is "Children, Social Work and Housing" the expression still returns the first set of Local Authorities.
Could use some help as not sure what I am doing wrong here (Can I not pass the OR statements with Switch?)
Hi @Dr0idy
Your requirement is not clear.
Do you mean that given the value of Fields!Family_Grouping.Value you want the value of (Fields!Local_Authority.Value
In a SWITCH statement you can not write OR expression as resulting value.
If based on one of the values mentioned in the OR condition of Fields!Local_Authority.Value , you want the result to be
Fields!Family_Grouping.Value , then just reverse the SWITCH statement.
Share your pbix in google or one drive and paste the link here to understand better.
Cheers
ChennuSing
This is in Report Builder not the PowerBI Desktop client.
Sorry if I was unclear. In my dataset I have two columns one that tells me which Family Group the Indicator value belongs to and another that tells me which local authority it belongs to. I have a chart within a list tablix in the report builder and I want to show only specific local authorities in the chart depending on what the family group of the PI is. I had it working without the switch statement for one of the sets of OR statements as below.
Where the OR statement was
(Fields!Local_Authority.Value= "Stirling") OR
(Fields!Local_Authority.Value= "Fife") OR
(Fields!Local_Authority.Value= "Moray") OR
(Fields!Local_Authority.Value= "North Ayrshire") OR
(Fields!Local_Authority.Value= "East Lothian") OR
(Fields!Local_Authority.Value= "East Ayrshire") OR
(Fields!Local_Authority.Value= "Perth and Kinross") OR
(Fields!Local_Authority.Value= "South Ayrshire") OR
(Fields!Local_Authority.Value= "Scotland")
I am just unsure how to apply one set of OR tests for one family group and another for a second family group.
My data columns are
Indicator Code | Year | Local Authority | Value | Family Group |
Any help is greatly appreciated.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |