Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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, Month.
The query editor has data in below format:
Column : Country, Region, Month, Year, Sales 1, Sales 2, Sales % (Sales2/Sales1)
By using the above format, the % is shown as SUM for all region but it has to be a calculated difference of Sales 2/Sales1 for each month. When country filter is applied the percentage is displayed correctly.
What i need is to show the percentage difference between both sales dynamically but when no filter is applied it has to show difference data calculated on month basis.
Current Data Source reference:
By using the above format, the % is shown as SUM for all region but it has to be a calculated difference of Sales 2/Sales1 for each month. Required Output Eg. January = Sales2/Sales1 = January Sales %
HI @tamilkumaran,
You can take a look at following blog if you are try to use filter to make axis dynamic:
Dynamic Attributes In A Power BI Report
After you modify your table structure, you can use the formula that Greg Deckler shared to combine with a dynamic attribute filter to achieve a dynamic visual.
Regards,
Xiaxoin Sheng
is this what you are searching for?
Sum of Sales 1 = SUM('Table'[Sales 1])
Sum of Sales 2 = SUM('Table'[Sales 2])
Percentage = DIVIDE([Sum of Sales 2],[Sum of Sales 1])
Regards FrankAT
@tamilkumaran , not very clear, you can use time intelligence and date table
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
previous month value = CALCULATE(sum('table'[total hours value]),previousmonth('Date'[Date]))
or diff between two sales
Measure = divide(SUM('Sales '[Sales 2]),SUM('Sales '[Sales 1]))
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
@tamilkumaran - 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.
@Greg_Deckler @amitchandak @FrankAT
Let me try to explain in a better way, the outcome i am expecting is.
Region Filter
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.
@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)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |