Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi!
I have a report table where there is a first column with different categories and followed by Current Month amount, previous month amt, YTD amounts . I need to append a new row in the report which will show me the difference between two categories when the report is refreshed.
Category | CY Amt | PY Amt | YTD Amt |
Sales | 4243 | 5664 | 356 |
Cost | 5345 | 6474 | 7575 |
Salary | 53456 | 64457 | 7567 |
Expenses | 543 | 4566 | 8678 |
Oveheads | 6464 | 4645 | 8678 |
1
I want to create a new row within the same table which will show me a new category with a difference between the Sales and the cost as Gross Profit
Something like this:
Category | CY Amt | PY Amt | YTD Amt |
Sales | 4243 | 5664 | 356 |
Cost | 5345 | 6474 | 7575 |
Gross Profit | -1102 | -810 | -7219 |
Salary | 53456 | 64457 | 7567 |
Expenses | 543 | 4566 | 8678 |
Oveheads | 6464 | 4645 | 8678 |
Any help will be greatly appreciated
Thanks
Solved! Go to Solution.
Hi @Miska ,
In PowerBI, the newly added data exists in the form of rows, and different dax are created to calculate different columns. I did the following test. I need to transpose the rows and columns in the power query first, and then create a measure in the desktop to calculate the Gross Profit for the sales column and the cost column.
Gross-Profit = MAX('Table (2)'[Sales])-MAX('Table (2)'[Cost])
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Miska ,
In PowerBI, the newly added data exists in the form of rows, and different dax are created to calculate different columns. I did the following test. I need to transpose the rows and columns in the power query first, and then create a measure in the desktop to calculate the Gross Profit for the sales column and the cost column.
Gross-Profit = MAX('Table (2)'[Sales])-MAX('Table (2)'[Cost])
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
We have like Category and subcategories under the categories so it will be like around 100 subcategories and couple million records for this. I tried it but does not seem to work .
Thanks
Hi @Miska ,
What is the specific error display, transpose the rows and columns in the power query should not affect the calculation. Can you provide detailed test data model information (delete sensitive information), I will answer you as soon as possible.
Looking forward to your reply.
Best Regards,
Henry
User | Count |
---|---|
125 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |