Forum Discussion
Classification measure from user selected classes number
- Anonymous2 years ago
Hi rufmau68_ozvvj ,
Since you need to group dynamically and the calculated columns can't change dynamically, we can only create a measure to implement the grouping, but due to the design, the measure can't be placed on the legend field and the shape map doesn't support conditional formatting of the colors, so we can create a filled map instead.
Here are my steps you can follow as a solution.
(1)Create tables.
SlicerTable = GENERATESERIES(1,20,1)Slicer2 = GENERATESERIES(1,20,1)(2)Create measures.
Measure = RANKX(ALLSELECTED('Table'),[birth numbers],MAX('Table'[birth numbers]),DESC,Dense)Measure 3 = var a=MAXX(ALLSELECTED('Slicer2'[Value]),[Value]) VAR B=MAXX(ALLSELECTED('Table'[district name]),[Measure]) VAR C= ROUNDDOWN(B/a,0) var d= ADDCOLUMNS(ALLSELECTED(SlicerTable[Value]),"test",SWITCH(TRUE(),[Value]<a,CONCATENATEX(GENERATESERIES(([Value]-1)*C+1,[Value]*C,1),[Value],","),[Value]=a,CONCATENATEX(FILTER(ALLSELECTED('Table'),[Measure]>=([Value]-1)*C+1&&[Measure]<=b),[Measure]))) RETURN MAXX(FILTER(d,[Value] in VALUES(SlicerTable[Value])),[test])Measure 4 = MAXX(FILTER(SlicerTable,CONTAINSSTRING([Measure 3],[Measure])),[Value])Color = SWITCH(TRUE(), [Measure 4]=1,"blue", [Measure 4]=2,"red", [Measure 4]=3,"yellow")Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi rufmau68_ozvvj ,
Since you need to group dynamically and the calculated columns can't change dynamically, we can only create a measure to implement the grouping, but due to the design, the measure can't be placed on the legend field and the shape map doesn't support conditional formatting of the colors, so we can create a filled map instead.
Here are my steps you can follow as a solution.
(1)Create tables.
SlicerTable = GENERATESERIES(1,20,1)Slicer2 = GENERATESERIES(1,20,1)
(2)Create measures.
Measure =
RANKX(ALLSELECTED('Table'),[birth numbers],MAX('Table'[birth numbers]),DESC,Dense)Measure 3 = var a=MAXX(ALLSELECTED('Slicer2'[Value]),[Value])
VAR B=MAXX(ALLSELECTED('Table'[district name]),[Measure])
VAR C= ROUNDDOWN(B/a,0)
var d= ADDCOLUMNS(ALLSELECTED(SlicerTable[Value]),"test",SWITCH(TRUE(),[Value]<a,CONCATENATEX(GENERATESERIES(([Value]-1)*C+1,[Value]*C,1),[Value],","),[Value]=a,CONCATENATEX(FILTER(ALLSELECTED('Table'),[Measure]>=([Value]-1)*C+1&&[Measure]<=b),[Measure])))
RETURN MAXX(FILTER(d,[Value] in VALUES(SlicerTable[Value])),[test])Measure 4 = MAXX(FILTER(SlicerTable,CONTAINSSTRING([Measure 3],[Measure])),[Value])Color = SWITCH(TRUE(),
[Measure 4]=1,"blue",
[Measure 4]=2,"red",
[Measure 4]=3,"yellow")
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.