Forum Discussion
Dynamic segmentation
Not very clear, but refer
https://community.powerbi.com/t5/Desktop/BIN-Range-Dynamic-Segmentation-based-on-measure/m-p/879288
https://community.powerbi.com/t5/Desktop/Dynamic-Segmentation-with-duplicate-rows/m-p/379859
- tlamoureux6 years agoFrequent Visitor
Hello,
Thank you for your answer but I have already found this thread and it does not help.
Here is a simple illustration of what I need.
If query2 is composed of these elements :
ShodID ShopName Date Rank
1 Toulouse 01/01/2019 8 1 Toulouse 02/01/2019 8 1 Toulouse 03/01/2019 8 1 Toulouse 01/01/2020 9 1 Toulouse 02/01/2020 9 2 Nice 01/01/2019 6 If I apply no filter, I will have this result
Rank Number Of Shop 0 0 1 0 2 0 3 0 4 0 5 0 6 1 7 0 8 1 9 0 Then, if I apply the filter Year=2020, the result will be :
Rank Number Of Shop 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 1 First I calculate the aggregation on the average in the time periode and then I apply the floor function to obtain the rank.
Thanks for help.
Thierry
- tlamoureux6 years agoFrequent Visitor
Hi,
I'm still stuck with this problem. Can someone help ?
Thank you very much,
Thierry.
- tlamoureux6 years agoFrequent Visitor
Hello,
I've found by myself but I still have some question. I used this thread with the bellow DAX formula :
Segmented stores = COUNTROWS ( FILTER ( ADDCOLUMNS ( VALUES ( Data[StoreID] ), "ABCD", CALCULATE ( [Total sales], CALCULATETABLE ( VALUES ( Data[StoreID] ) ), ALLSELECTED () ) ), COUNTROWS ( FILTER ( Buckets, [Total sales] >= Buckets[Lower] && [Total sales] <= Buckets[Upper] ) ) > 0 ) )I've two questions, the first is about the CALCULATE, I don't understand why the VALUES(Data[StoreID]) is in the CALCULATETABLE function. If I only put the VALUES function it does not work but I do not see the difference as there is no argument for CALCULATETABLE. Then, I do not understand the goal of the ALLSELECTED(), if delete this line, I have the same result.
I have inserted in my report this bar graph :
The value are exactly what I expected but, when I click on a bar, the other element of my report are not updated : if I click on the bar "0 à 1", the list of shops may be reduced to a number of 5. Do you have an idea why it does not work ?
Thank you very much,
Thierry