Forum Discussion
tamilkumaran
6 years agoFrequent Visitor
Calculate percentage difference between two column-individual row and difference of column for month
I have a requirement to show the percentage difference between two columns dynamically based on user selection in filter. I am providing 3 individual filters to user as Slicer - Region, Country, Mo...
Greg_Deckler
Community Champion
6 years agotamilkumaran - I could be missing something here but it seems like you should just have to create a measure like:
Measure = DIVIDE(SUM('Table'[Sales 2]),SUM('Table'[Sales 1]),0)
That should work for any filter context you wish to apply, month, month and country, etc.
- tamilkumaran6 years agoFrequent Visitor
Greg_Deckler amitchandak FrankAT
Let me try to explain in a better way, the outcome i am expecting is.
- If no filters or Region filter is applied by the user the chart should show the percentage by calculating the difference between two columns by SUM of January Sales 2/January Sales 1 - same way for other months Feb, March...etc
Region Filter
- If Country Filter is selected by user then the chart should show the percentage by calculating the difference between two columns by each row of the selected Country for that month.
I am very sorry if i am still not able to explain it to you clearly but this is my requirement to show the data.
Thank you for helping me.
- Greg_Deckler6 years ago
Community Champion
tamilkumaran - Still not sure what you are going for here, but for your requirement you can switch how something is calculated by checking ISFILTERED. So:
Measure = VAR Calc1 = <some calculation by month> VAR Calc2 = <some calculation by country and month or i'm not really sure> RETURN IF(ISFILTERED('Table'[Country]),Calc2,Calc1)