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.
Hi there,
Thank you for your help. I got 2 table and I would like to sum the Net Sales. I have tried different mearsures, but they either wrong total or missing total.
Table Structure as below:
Table 1 Promotion Period
ArticleCode SiteCode End_Date (Measure Caluate sales after EndDate)
Table 2 Txn Details
ArticleCode SiteCode Billing_Date NET_SALES
M2:
Solved! Go to Solution.
Hi @sammy02hk
please try
M1 =
SUMX (
SUMMARIZE (
'Table1',
'Table1'[Article_Code],
'Table1'[SiteCode],
'Table1'[End Date_New]
),
VAR a = 'Table 1'[End Date_New]
VAR n = 'Table 1'[SiteCode]
RETURN
CALCULATE (
SUM ( 'Table 2'[NET_SALES] ),
'Table 2'[BILLING_DATE] > a
&& 'Table 2'[SITE_CODE] = n
)
)
AfterPeriodSalesM =
SUMX (
SUMMARIZE (
'Table1',
'Table1'[Article_Code],
'Table1'[SiteCode],
'Table1'[End Date_New]
),
VAR a = 'Table 1'[End Date_New]
VAR n = 'Table 1'[SiteCode]
RETURN
CALCULATE (
SUMX ( 'Table 2', VALUE ( 'Table 2'[NET_SALES] ) ),
FILTER ( 'Table 2', 'Table 2'[BILLING_DATE] > a && 'Table B'[SITE_CODE] = n )
)
)
Hi @sammy02hk
please try
M1 =
SUMX (
SUMMARIZE (
'Table1',
'Table1'[Article_Code],
'Table1'[SiteCode],
'Table1'[End Date_New]
),
VAR a = 'Table 1'[End Date_New]
VAR n = 'Table 1'[SiteCode]
RETURN
CALCULATE (
SUM ( 'Table 2'[NET_SALES] ),
'Table 2'[BILLING_DATE] > a
&& 'Table 2'[SITE_CODE] = n
)
)
AfterPeriodSalesM =
SUMX (
SUMMARIZE (
'Table1',
'Table1'[Article_Code],
'Table1'[SiteCode],
'Table1'[End Date_New]
),
VAR a = 'Table 1'[End Date_New]
VAR n = 'Table 1'[SiteCode]
RETURN
CALCULATE (
SUMX ( 'Table 2', VALUE ( 'Table 2'[NET_SALES] ) ),
FILTER ( 'Table 2', 'Table 2'[BILLING_DATE] > a && 'Table B'[SITE_CODE] = n )
)
)
Hi It works.
I have try different way to use summarize as well. But it didn't work out.
Lets me study how to embed this...
Thank you very much
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |