stretcharm
7 years agoMemorable Member
PowerBI Custom Visuals
Its been a while since this Visual Explorer by Anonymous
https://community.powerbi.com/t5/Data-Stories-Gallery/Power-BI-Custom-Visuals-Explorer/m-p/187266
stopped working so I decided to buil...
GreetSmekens
6 years agoRegular Visitor
Hi,
I cannot seem to merge multiple filters.
Let say I want city, age and sex as facets and the respective locations, gender and age categories as instances.
this to filter sportsparticipation on a shapemap.
Bit similar to yoour example. But I can't add multiple facets or instances.
Could you point me in the right direction?
thanks!
stretcharm
6 years agoMemorable Member
I use a Dax table.
I create small summaries of the fields I want and then union the results. I then connect to the main table that I'm filtering. I have to use bidirectional filters otherwise the facet filters don't work. Originally I did this in M but its much faster and simpler in Dax.
Facets =
VAR _Category =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE ( Categories, Categories[Tag], Categories[Code] ),
"Category", "Category",
"Style", "fa fa-bars"
),
"Category", [Category],
"Style", [Style],
"Tag", [Tag],
"Code", [Code]
)
VAR _Rating =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE ( GetPageEntries, GetPageEntries[Rating], GetPageEntries[Code] ),
"Category", "Rating",
"Style", "fa fa-star"
),
"Category", [Category],
"Style", [Style],
"Tag", [Rating],
"Code", [Code]
)
VAR _Publisher =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE ( GetPageEntries, GetPageEntries[Publisher], GetPageEntries[Code] ),
"Category", "Publisher",
"Style", "fa fa-windows"
),
"Category", [Category],
"Style", [Style],
"Tag", [Publisher],
"Code", [Code]
)
VAR _New =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE (
FILTER ( GetPageEntries, GetPageEntries[New]<>"" ),GetPageEntries[Code]),
"Category", "Tag",
"Style", "fa fa-new",
"Tag", "New"
),
"Category", [Category],
"Style", [Style],
"Tag", [Tag],
"Code", [Code]
)
VAR _Certified =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE (
FILTER ( GetPageEntries, GetPageEntries[Certified]<>"" ),GetPageEntries[Code]),
"Category", "Tag",
"Style", "fa fa-certificate",
"Tag", "Certified"
),
"Category", [Category],
"Style", [Style],
"Tag", [Tag],
"Code", [Code]
)
VAR _Price =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE ( GetPageEntries, GetPageEntries[Price], GetPageEntries[Code] ),
"Category", "Tag",
"Style", "fa fa-dollar"
),
"Category", [Category],
"Style", [Style],
"Tag", [Price],
"Code", [Code]
)
VAR _VisualType =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE ( GetPageEntries, GetPageEntries[Visual Type], GetPageEntries[Code] ),
"Category", "Tag",
"Style", "fa fa-signal"
),
"Category", [Category],
"Style", [Style],
"Tag", [Visual Type],
"Code", [Code]
)
VAR _GitHub =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE (
FILTER ( GetPageEntries, GetPageEntries[Github URL]<>"" ),
GetPageEntries[Code]
),
"Category", "Tag",
"Style", "fa fa-github",
"Tag", "GitHub"
),
"Category", [Category],
"Style", [Style],
"Tag", [Tag],
"Code", [Code]
)
VAR _Tag =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE ( Words, Words[Word], Words[Code] ),
"Category", "Keywords",
"Style", "fa fa-tag"
),
"Category", [Category],
"Style", [Style],
"Tag", [Word],
"Code", [Code]
)
RETURN
UNION (
_Tag,
_New,
_Category,
_Certified,
_Price,
_Publisher,
_Rating,
_VisualType,
_GitHub
)