Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 ??
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |