Forum Discussion
calculation between two rows to get result
Hi Experts,
I have a matrix visual as below and I would like to calculate Output/ Input = Production recovery % at Process name level
| Production area | Process name | Process line name | Production Type | Actual M3 | Forecast M3 | Budget M3 |
| California | Drying | Dry base | input | 10 | 10 | 10 |
| output | 8 | 8 | 8 | |||
| Compacting | Extraction | input | 10 | 10 | 10 | |
| output | 7 | 7 | 7 | |||
| Pelleting | output | 8 | 8 | 8 | ||
| Greening | Stacking | input | 10 | 10 | 10 | |
| output | 6 | 6 | 6 | |||
| Peeling | input | 10 | 10 | 10 | ||
| output | 9 | 9 | 9 | |||
| Milling | Planing | input | 10 | 10 | 10 | |
| output | 9 | 9 | 9 | |||
| Joining | Priming | input | 10 | 10 | 10 | |
| output | 8 | 8 | 8 |
Desired output should look like this. This is using direct query and each fields and values coming from different cubes with relationships.
Thanks
2 Replies
- Jihwan_Kim
Super User
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
- logistics_powerRegular Visitor
Thanks for your response
My model is something like this. Tables as below
The values Actual, Forecast and Budget M3 are measures existing in the model itself that I am pulling in matrix visual.
I am not adding anything in the matrix visual columns.
Values are in the values.
production area, process name, proces line name, production type are added in this order in the rows section.
Your model being slightly different, when I add the new measure to the values it is added as a new column at the end in the visual instead of as a row near the input/output.
Is there any other way we can writ the DAX?
Thanks