I have the folowing data
I want to be able to filter by reason
When i filter by reason 1
if should appear this ways
when i filter by
reason 2
It should bu
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
I created dax measure
Value =
DIVIDE(sum('Table'[Total]),
CALCULATE(all(sum('Table'[Total]))))
is given me error
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) :
Reason 1 : equal to "Per" if Per column = "Reason 1" otherwise equals to "Per remaining". Here is Power Query code for this new column :
IF [Per] = "Reason 1" THEN "Per" ELSE "Per Remaining"
Reason 2 : equal to "Per remaining" if Per column = "Reason 1" otherwise equals to "Per". Here is Power Query code for this new column :
IF [Per] = "Reason 1" THEN "Per remaining" ELSE "Per"
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 :
Per
Reason 1
Reason 2
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.