Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have two fact tables -
Fact1 (CustomerID, ProductID, DateKey, Value1) , Fact2 (CustomerID, ProductID,DateKey,Value2)
I'm trying to get a summarized table that gives me
Summary Table = CustomerID, ProductID, DateKey, Sum(Value1), Sum(Value2)
I tried using the Summarize function, but it doesn't work.
If I do SUMMARIZE on Fact1, I get the Sum(Value1) but Sum(Value2) is blank. If I do SUMMARIZE on Fact2 , the Sum(Value1) is blank.
The two FACTS are both related to a Customer, Product & Date Dim table. But there's no direct relationship between them.
I tried creating a KEY column in both FACT tables and do a USERELATIONSHIP, that didn't work either.
Appreciate any guidance to resolve this ..
Solved! Go to Solution.
hi @parimal
for example
Table =
AddColumns(
SUMMARIZE(Fact1, Fact1[CustomerID], Fact1[ProductID], Fact1[DateKey], "Sum1", SUM(Fact1[Value1])),
"Sum2", CALCULATE(SUM(Fact2[Value2]), FILTER(ALL(Fact2), Fact2[CustomerID]=[CustomerID] && Fact2[ProductID]=[ProductID] && Fact2[DateKey]=[DateKey]))
)
hi @parimal
for example
Table =
AddColumns(
SUMMARIZE(Fact1, Fact1[CustomerID], Fact1[ProductID], Fact1[DateKey], "Sum1", SUM(Fact1[Value1])),
"Sum2", CALCULATE(SUM(Fact2[Value2]), FILTER(ALL(Fact2), Fact2[CustomerID]=[CustomerID] && Fact2[ProductID]=[ProductID] && Fact2[DateKey]=[DateKey]))
)
Superb.. Thanks a lot. This worked..
I was trying a similar statement for a long time, but I was doing FILTER(Fact2, .... ) , whereas you did a FILTER(ALL(FACT2)... )
putting the ALL made all the difference.. , any idea why it might not have been working without the ALL ??
User | Count |
---|---|
124 | |
108 | |
99 | |
62 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |