Forum Discussion
Problem with Switch and Selected Value Function
- 6 years ago
You have 2 possiblities. Talk to the people who are doing the extract and ask them to provide you with an un-pivoted set of data, or use power query inside power bi to unpivot the data before you start analyzing it.
It might help generally, with all your visualzations and dax measures, to unpivot your data before you start
| Statement | Account | Order |
| L1 | 14. Profit before tax | 1 |
| L1 | 15. CIT | 2 |
| L1 | 16. Deferred tax | 3 |
| L1 | 17. Profit after tax | 4 |
| L1 | 17. Profit after tax | 4 |
| L2 | 14. Profit before tax | 1 |
| L2 | 15. CIT | 2 |
| L2 | 16. Deferred tax | 3 |
| L2 | 17. Profit after tax | 4 |
| L2 | % Profit | 5 |
Your data looks like it might be coming from a report in excel. Manipulating data where you have it laid out like a pivot table can introduce some weird kinks.
I loaded this table into your test file and just added some fields to a pivot table
I did not try to replicate your calculations, this was just an example to show how the results "fall out" alot easier if the data is in a form that Power Bi "likes"
This is an example of applying Slogan 1 of the 7 Slogans for working with Power BI. You can find more details here https://bislogans.com/3-shape-your-business-data-before-you-load-it-into-power-bi/
Hi kel thanks for the help, the report is extracted from a bigger model from SQL Database table
- kentyler6 years agoSolution Sage
You have 2 possiblities. Talk to the people who are doing the extract and ask them to provide you with an un-pivoted set of data, or use power query inside power bi to unpivot the data before you start analyzing it.
- kentyler6 years agoSolution Sage
just to make things cliear, here is the dummy table i built to represent the un-povited data
Statement Account Result Order L1 14. Profit before tax 67 1 L1 15. CIT 8 2 L1 16. Deferred tax 89 3 L1 17. Profit after tax 55 4 L1 17. Profit after tax 44 4 L2 14. Profit before tax 9 1 L2 15. CIT 344 2 L2 16. Deferred tax 6 3 L2 17. Profit after tax 44 4 L2 % Profit 666 5