powerbidaxreportpowerbi-desktop

power bi donut and slicer


I have the folowing data

enter image description here

I want to be able to filter by reason When i filter by reason 1 if should appear this ways enter image description here when i filter by reason 2 It should bu enter image description here

That is reason 1 will be Percentage of reason one which is 40% minus 100% Which will be 60% same as reason 2

When no filter is selected it should be

enter image description here

I created dax measure

Value = 
DIVIDE(sum('Table'[Total]),
CALCULATE(all(sum('Table'[Total]))))

is given me error


Solution

  • You can use field parameter to achieve your needs.

    First, you can use Power Query to rename the column reason by Per, then you will need to create 2 new columns (using custom column or conditional column) :

    The final table should look like that :

    Reason Total Reason 1 Reason 2
    Reason 1 120 Per Per remaining
    Reason 2 80 Per remaining Per remaining

    Now you will need to create a field parameter including the following columns :

    You can now add a slicer with this new parameter, in the formatting panel of the slicer you need to select unique selection so that the user can only one in "Per" / "Reason 1" / "Reason 2".

    Now create your principal visual, you will need to put the parameter in the legend field and Total column as the value field. To get the titles of the graph dynamics go to the formatting panel => General => Title there select conditional formatting and put the parameter there.

    Here is the result : Per selected / Reason 2 selected / Reason 1 selected

    Hope this helps.