March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi
I have got three tables customer , measure table, material. task is to count customer hierarchies spend in customer table (in different Material categories in Material tables. even though their is no direct connection.
customer table measure table material table
customer No ------> customer no Material Categories
Customer Name Material no ------->Material no
customer Hierarcy spend material name.
please help
Solved! Go to Solution.
@Anonymous , As measure table is Fact
we should be able to have a visual
customer Hierarchy, Material Categories and sum of spend
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hi @Anonymous ,
I create a sample to have a test.
Customer Table:
Measure Table:
Material Table:
Relationship:
Try this code:
Distinct Count =
VAR _ADD =
ADDCOLUMNS (
'Measure',
"Customer Hierarcy", RELATED ( Customer[Customer Hierarcy] ),
"Material Categories", RELATED ( Material[Material Categories] )
)
VAR _SUMMARIZE =
SUMMARIZE ( _ADD, [Material Categories], [Customer Hierarcy] )
RETURN
COUNTAX ( _SUMMARIZE, [Customer Hierarcy] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I create a sample to have a test.
Customer Table:
Measure Table:
Material Table:
Relationship:
Try this code:
Distinct Count =
VAR _ADD =
ADDCOLUMNS (
'Measure',
"Customer Hierarcy", RELATED ( Customer[Customer Hierarcy] ),
"Material Categories", RELATED ( Material[Material Categories] )
)
VAR _SUMMARIZE =
SUMMARIZE ( _ADD, [Material Categories], [Customer Hierarcy] )
RETURN
COUNTAX ( _SUMMARIZE, [Customer Hierarcy] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , As measure table is Fact
we should be able to have a visual
customer Hierarchy, Material Categories and sum of spend
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |