Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello everyone,
I am new to this forum.
I have a data table with columns for date, category, product, and price. I am seeking to create a DAX function to calculate the total price of a specific product for the previous year combined with the current year for one product-only current year price. My objective is to display the total price for the current year. How can I accomplish this task?
Solved! Go to Solution.
Hi @ajet-p_91,
You don't need to create a DAX to fulfill your needs.
For the /Price/ column a numeric aggregation is automatically applied.
After adding the /Price/ column to the visual object, it will adaptively filter the display values based on the row and column labels.
For example, in the Matrix visualization object.
The rows labels are the /Product/ and /Date/ (year), and the value field is the /Price/.
The Price column will show the total price of each product for two years.
The next level down shows the total price of each product for last year and this year.
Another example is that you can add Product and Date fields to the slicer visual object.
You can manually choose to display the total price of which product for which year, or to display the total price for two years.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ajet-p_91,
You don't need to create a DAX to fulfill your needs.
For the /Price/ column a numeric aggregation is automatically applied.
After adding the /Price/ column to the visual object, it will adaptively filter the display values based on the row and column labels.
For example, in the Matrix visualization object.
The rows labels are the /Product/ and /Date/ (year), and the value field is the /Price/.
The Price column will show the total price of each product for two years.
The next level down shows the total price of each product for last year and this year.
Another example is that you can add Product and Date fields to the slicer visual object.
You can manually choose to display the total price of which product for which year, or to display the total price for two years.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |