March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello everybory, I hope you are doing well. I have a simple question, and I would like your help.
I need to create a different slicer filter here, and I do not know how to handle it.
The following image represents my current model.
What do I want to do?
When I select Province A in my slicer, in fact, I wanna choose Provinces A,B,C,D
When I select Province B in my slicer, in fact, I wanna choose Provinces B,C,D,
and so on...
It is essential to say that I do not have a hierarchy here. My provinces are all on the same level.
My Power Bi sample is available here.
https://drive.google.com/file/d/1PvZxomKnPm-fjSii9j3uW0itK566QA5Y/view?usp=sharing
Thank you
Solved! Go to Solution.
See what you make of this:
There is a calculation group configured via tabular editor:
-----------------------------------------------------------
-- Calculation Group: 'Province Selection Calulation Group'
-----------------------------------------------------------
CALCULATIONGROUP 'Province Selection Calulation Group'[Name] Precedence = 1
CALCULATIONITEM "Select Provinces" =
VAR MinIndex = MIN ( Province[Index] )
RETURN
CALCULATE(
SELECTEDMEASURE(),
REMOVEFILTERS( Province[Povince] ),
Province[Index] >= MinIndex
)
Basically the same measure but you don't need the calcualted table bit.
Then you just drop the calculation group into the visual level filter pane:
This article explains more on creating them using tabular editor:
Introducing Calculation Groups - SQLBI
Simple enough, add an index column to Province table,
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
I liked it, and it works. However, I did not mention I have 53 measures, and in this case I would need to change all of them.
I like @ThxAlot solution in DAX.
You could apply it to all measures by using a calculation group (configured via tabular editor). Just replace [val] with SELECTEDMEASURE(). Am away from a computer at the moment but can demo it later if you'd like.
Scroll down the thread. Have sent a demo and a link to a SQLBI intro.
Calculation group editing I believe is coming to native power bi desktop at some point but not sure when.
If you want it to be as easy as possible for end users my original suggestion of a bridge table might be a better way forward (although doubt the calc group would need changing)
See what you make of this:
There is a calculation group configured via tabular editor:
-----------------------------------------------------------
-- Calculation Group: 'Province Selection Calulation Group'
-----------------------------------------------------------
CALCULATIONGROUP 'Province Selection Calulation Group'[Name] Precedence = 1
CALCULATIONITEM "Select Provinces" =
VAR MinIndex = MIN ( Province[Index] )
RETURN
CALCULATE(
SELECTEDMEASURE(),
REMOVEFILTERS( Province[Povince] ),
Province[Index] >= MinIndex
)
Basically the same measure but you don't need the calcualted table bit.
Then you just drop the calculation group into the visual level filter pane:
This article explains more on creating them using tabular editor:
Introducing Calculation Groups - SQLBI
I think the easiest way would be to use a bridge table with two columns:
Province Selection, Included
A, A
A, B
A, C
A, D
B, B
B, C
B, D
C, C
C, D
D, D
Then create a many to many relationship with filter in one direction from it to the City Table.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
44 |
User | Count |
---|---|
204 | |
105 | |
99 | |
64 | |
54 |