Forum Discussion
Use Slider selectedvalue in calculation and plot results in circlediagram view
- Anonymous2 years ago
Hi Aglaerion ,
Please try the following methods and check if they can solve your problem:
1.Create the simple tables.
2.Select the slicer visual and drag the Ticket price into the slicer.
3.Create a new measure to calculate total. Enter the following DAX formula.
Total Cost = VAR SelectedTicketPrice = SELECTEDVALUE(Slicer[Ticket price], 0) VAR NumberOfKids = SUM(Person[Kids]) RETURN NumberOfKids * SelectedTicketPrice4.Drag the Total cost to the visual.
5.Create a new measure to calculate category. Enter the following DAX formula.
Cost Category = SWITCH( TRUE(), [Total Cost] < 20, "CAT1", [Total Cost] >= 20 && [Total Cost] < 30, "CAT2", [Total Cost] >= 30, "CAT3", "OTHER" )6.Create three measures for the category.
Category1 = CALCULATE( COUNTROWS(Person), FILTER( Person, [Cost Category] = "CAT1" ))Category2 = CALCULATE( COUNTROWS(Person), FILTER( Person, [Cost Category] = "CAT2" ))Category3 = CALCULATE( COUNTROWS(Person), FILTER( Person, [Cost Category] = "CAT3" ))7.Drag three measures into the pie chart. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tx bro, the solution was that I had indeed create measures for the categories each with the count statement.
I used this :
CAT1 = COUNTX(FILTER('Person',[Category]="CAT1"),[Category])
CAT2 = COUNTX(FILTER('Person',[Category]="CAT2"),[Category])
Tx for the headsup mate. Apreciated!