Forum Discussion
Create a relationship using Specific or All values
Hi,
I have an issue and I don't have idea how solve it.. I need help.. please..
I am creating a balance report in PBI, in a File I have the menu with the options (rows) to display and each row has the group of balance sheet accounts to summarize.
It is something like this:
| Report_Name | codeMenu | Line# | Submenu | Row Description | Submenu | Row Description | Account Type | Account Sub | Cat3 | Cat6 |
| Main Expenses | A002 | 6 | A0026 | Other Expenses | A00261 | Maintenance Uniforms | 1010 | 1900 | REC | *All |
| Main Expenses | A002 | 6 | A0026 | Other Expenses | A00262 | Misc. | 1010 | 1360 | REC | OTH |
| Main Expenses | A002 | 6 | A0026 | Other Expenses | A00265 | Misc. | 1010 | 1990 | REC | *All |
| Main Expenses | A002 | 6 | A0026 | Other Expenses | A00269 | tablecloths | 7307 | 1002 | REC | MAR |
On the Other hand, I have another file with a balance of transactions to summarize by group of accounts
It is something like this:
| Object | Sub | Description | BU Cat03 | BU Cat06 | JAN | FEB |
| 1010 | 1900 | Uniforms | REC | MAR | 100.00 | 743.34 |
| 1010 | 1900 | Uniforms | MOP | MAR | 95.00 | - |
| 1010 | 1900 | Uniforms | REC | SEA | 302.00 | 488.00 |
| 1010 | 1900 | Uniforms | MOP | MAR | 35.00 | 65.00 |
| 1010 | 1990 | Miscellaneous | REC | MAR | 122.00 | 60.00 |
| 1010 | 1990 | Miscellaneous | MOP | MAR | 85.00 | 120.00 |
| 1010 | 1990 | Miscellaneous | REC | SEA | 100.00 | 101.49 |
| 1010 | 1990 | Miscellaneous | MOP | MAR | 505.00 | - |
| 1010 | 1990 | Miscellaneous | REC | SEA | 12.00 | 365.00 |
| 1010 | 1990 | Miscellaneous | H1H | SEA | 120.00 | 11.00 |
| 1010 | 1990 | Miscellaneous | REC | MAR | 878.00 | - |
| 7307 | 1002 | Uniforms - Qualified | REC | OTH | - | 250.00 |
| 7307 | 1002 | Uniforms - Qualified | PHO | HTL | 200.00 | 100.00 |
| 7307 | 1002 | Uniforms - Qualified | REC | MAR | 345.00 | 500.00 |
| 7307 | 1002 | Uniforms - Qualified | FOO | HTL | 122.00 | 55.00 |
| 7307 | 1002 | Uniforms - Qualified | REC | SEA | 250.00 | 300.00 |
Now, in the report the idea is display 1 row with the total, in this Case
| Main Expenses | Expenses type | JAN | FEB |
| Other Expenses | 2,691.00 | 2,888.83 |
Now, the problem I have is Summarize the amounts depending of the category codes (Cat3 and Cat 6), because sometimes I have specific Cat3 and Cat 6, by example the code A00269 have Cat3='REC' and Cat6='MAR', but in the other cases I have a specific Cat 3, but with all Category code 6 (By example the code A00261 has Cat3='REC' but with all category code 6 (Cat6).
I can't create a relationship between both files, due there are a lot of records with distinct Category code 6 and combinations
If any of you have an idea of how to handle this type of case, could you guide me on how to resolve it?
Hi gomezc73 ,
Try the following formula:
Total Values = VAR temp_table = FILTER ( CROSSJOIN ( 'Balance sheet accounts', 'Balance Transactions' ), 'Balance sheet accounts'[Account Sub] = 'Balance Transactions'[Sub] && 'Balance sheet accounts'[Account Type] = 'Balance Transactions'[Object] && 'Balance sheet accounts'[Cat3] = 'Balance Transactions'[BU Cat03] && ( 'Balance sheet accounts'[Cat6] = 'Balance Transactions'[BU Cat06] || 'Balance sheet accounts'[Cat6] = "*All" ) ) RETURN SUMX ( temp_table, 'Balance Transactions'[Value] )This is giving the correct result for the small sample you present however not sure if it will return correctly on your overall values since the details can make all the difference:
Also be aware that I have unpivot the transactions in order not to have a calculation for each column.
Check PBIX file attach.
That command CrossJoin works fine. I really appreciate your help.. thank you very much!!
10 Replies
- MFelixSuper User
Hi gomezc73 ,
In this case you should create two dimension tables with the Cat3 and CAT 6 then relate this tables with the other two that will create the relationship that you refer.
Just one question when it says on CAT6: *All is this the value that you have or you did not place all of the values on the example because they are a lot?
- gomezc73Helper V
Hi Miguel,
There are aprox 20 Category 6 (Cat6), then when I say '*All' is to no write in details the 20 codes of Cat6.
That's my concerns, in some rows I have to link both file only with 1 Cat 6, and there are other rows where no matter, because it is for all Cat6.