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
Hi all,
I would appreciate it if someone could help me please with my measures:
I have the following table:
| Date | Item | Price |
| 01.01.2020 | A | 20 |
| 01.01.2020 | A | 25 |
| 01.01.2020 | A | 30 |
| 03.01.2020 | A | 20 |
| 10.01.2020 | A | 35 |
| 02.01.2020 | B | 50 |
| 05.01.2020 | B | 60 |
| 01.01.2020 | C | 40 |
| 01.01.2020 | C | 45 |
| 01.01.2020 | C | 50 |
| 03.01.2020 | C | 40 |
| 10.01.2020 | C | 45 |
I have calculated the percentage change for each item taking the average price for the day based on the date slicer as follows:
Percent Change =
var _max = maxx(Table,Table[Date].[Date])
var _min = MINX(Table,Table[Date].[Date])
return
(CALCULATE(AVERAGE(Table[Price]), FILTER(ALLSELECTED(Table),Table[Date].[Date]=_max))-CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED(Table),Table[Date].[Date]=_min)))/CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED(Price),Table[Date].[Date]=_min))*100
When I select individual items, the percentage is calculated correctly between min and max dates as follows:
But when I select all items, I get different percentage changes
Can anyone please help me to get the correct percentage changes when I select all items (the same values as when I select just one item)? I would like to present changes for all items in a table.
Thanks
Solved! Go to Solution.
@dashbuilder , I created three versions of it, Please check those out in the file attached after signature
@dashbuilder , Create a separate date table and then try same formula with date table
example -
Percent Change =
var _max = maxx('DATE','DATE'[Date])
var _min = MINX('DATE','DATE'[Date])
return
(CALCULATE(AVERAGE(Table[Price]), FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_max))
-CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_min)))/
CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_min))*100
Also, use the divide function
@amitchandak thank you for your response. I have created a new data table as follows
Then, I altered the formula as suggested:
Percent Growth =
var _max = maxx('DATE','DATE'[Date])
var _min = MINX('DATE','DATE'[Date])
return
DIVIDE((CALCULATE(AVERAGE(Table[Price]), FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_max))
-CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_min))),
CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_min)))*100Now, I get "0"s:
Am I doing something wrong? Thank you heaps.
@dashbuilder , I created three versions of it, Please check those out in the file attached after signature
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 169 | |
| 109 | |
| 91 | |
| 55 | |
| 44 |