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
Solved! Go to Solution.
@TomMartens Thanks for the approach, but as you rightly said its tedious to implement. Instead i decided to change the data structure to unpivot the four columns and that way it will automatically add up when selected.
Hey @sujitjena ,
I would use a slightly different approach ...
You can create an unrelated table that holds all the options, but also uses a binary value (2^x) that encodes the options, the following table shows an example:
Then create a measure like the one below:
sum binarycode = SUM( 'unrelated table'[binarycode] )
Due to the nature of the binary values, you know what has been selected in the slicer.
Then create a measure like the one below (please be aware that it is not complete 🙂 )
final measure =
var SelectedOptions = [sum binarycode]
return
SWITCH(
SelectedOptions
, 1 , [Measure A]
, 2 , [Measure B]
, 3 , [Measure A] + [Measure B]
, 4 , [Measure C]
, 5 , [Measure A] + [Measure C]
, 6 , [Measure B] + [Measure C]
, 7 , [Measure A] + [Measure B] + [Measure C]
, 8 , [Measure D]
// all the other combinations
)
Creating the measure above is simple but can become a little tedious, depending on the number of options.
Hopefully, this provides an idea of how to tackle this.
Regards,
Tom
It's workinggggggggggg!!! Tks a lot Tom.
@TomMartens Thanks for the approach, but as you rightly said its tedious to implement. Instead i decided to change the data structure to unpivot the four columns and that way it will automatically add up when selected.
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 |
---|---|
115 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |