Forum Discussion
Recalculating Market Share based on selection
- Anonymous5 years ago
HI amitchandak
I found just the right solution actually (I believe and checked).
Market Share (whatever the context is always calculated by doijg = sum of sales of a part / sum of sales of all parts.
We know that calculate(sum(sales)) will be (if we let him) influenced by the "slicers".
The question is thus how we make a measure that defines the ALL PARTS segment, as we want that all part to be dynamic based on selection. That's where it hit me:
USE ALLSELECTED on the table you allow the recalculation to be done. And it works ... The total of all parts is recalculated based on filter selection.
What's your opinion on this?
Thanks a bunch.
Anonymous , based on what I got, you can use measure slicer Approach.
measure slicer
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern
Isinscope, isfiltered and hasonevalue should help
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115
Hi Amitchandak,
I used the first link yesterday for something else.
Basically, using inscope/hasonevalue/isfiltered/hasonefilter in combination of all the market share calculations would be your advice right?
Thanks a bunch.
- amitchandak5 years ago
Super User
Anonymous , so basically it will be based on the filter choose to measure. typically for Guage, you should be done with isfiltered and hasonebvalue.
In the case of visual with group/axis/row, you have to use isinscope too.
My example of card - https://www.youtube.com/watch?v=hXg3kRFSGjA
- Anonymous5 years agoNot applicable
HI amitchandak
I found just the right solution actually (I believe and checked).
Market Share (whatever the context is always calculated by doijg = sum of sales of a part / sum of sales of all parts.
We know that calculate(sum(sales)) will be (if we let him) influenced by the "slicers".
The question is thus how we make a measure that defines the ALL PARTS segment, as we want that all part to be dynamic based on selection. That's where it hit me:
USE ALLSELECTED on the table you allow the recalculation to be done. And it works ... The total of all parts is recalculated based on filter selection.
What's your opinion on this?
Thanks a bunch.
- v-lionel-msft5 years ago
Community Support
Hi Anonymous ,
I think so too, thank you for sharing.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.