The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a table with a LIKE
a | b | C | CUSTOMER |
LA | BC | CA |
20 |
LC | BA | 50 | |
LD | CC |
|
And tabbel B as same format
a | b | c | sale | Session |
LC | BA | 500 | 32443 | |
LD | BC | 111 | 343 | |
LA | CA | 22 | 34324 | |
LD | CA | 333Need Help | 34434 |
I want to create the visulization with the filterwith Hierarchy on a, b,c th Show and Tellat can cover both the table , looks to be the data model and DAX support
@Ritaf1983
Solved! Go to Solution.
Hi @santoshhmsam50 ,
You need to create the following relational columns in each table and then create hierarchical tables. Then apply the following formula to the metric table.
CombinedKey = [a] & "|" & [b] & "|" & [c]
HierarchyTable = DISTINCT(
UNION(
SELECTCOLUMNS('TableA', "a", [a], "b", [b], "c", [c]),
SELECTCOLUMNS('TableB', "a", [a], "b", [b], "c", [c])
)
)
SumCustomer =
CALCULATE(
SUM(TableA[CUSTOMER]),
TREATAS(
VALUES(HierarchyTable[CombinedKey]),
TableA[CombinedKey]
)
)
SumSales =
CALCULATE(
SUM(TableB[sale]),
TREATAS(
VALUES(HierarchyTable[CombinedKey]),
TableB[CombinedKey]
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot for solving and explaining it in such a simple way 🙂
Hi @santoshhmsam50 ,
You need to create the following relational columns in each table and then create hierarchical tables. Then apply the following formula to the metric table.
CombinedKey = [a] & "|" & [b] & "|" & [c]
HierarchyTable = DISTINCT(
UNION(
SELECTCOLUMNS('TableA', "a", [a], "b", [b], "c", [c]),
SELECTCOLUMNS('TableB', "a", [a], "b", [b], "c", [c])
)
)
SumCustomer =
CALCULATE(
SUM(TableA[CUSTOMER]),
TREATAS(
VALUES(HierarchyTable[CombinedKey]),
TableA[CombinedKey]
)
)
SumSales =
CALCULATE(
SUM(TableB[sale]),
TREATAS(
VALUES(HierarchyTable[CombinedKey]),
TableB[CombinedKey]
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot for solving and explaining it in such a simple way 🙂
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |