Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |