Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
spencer_II
Helper I
Helper I

If then measure returning incorrect totals

Sooo.... I have exhausted options, video's and forumns for a solution.  Mutliple attempts with SUMX and SUMX w/ SUMMARIZE. None leading to a correct total.

 

Customer and Item No-Description are from two different dimension tables. The solutions attempted would have worked if first two columns both existed in same table.

Cnt Fcst equals Bdgt is an if/then measure as follows:

Cnt Fcst equals Bdgt =
VAR doesmatch=IF([Forecast Cases]=[Budget Cases],1,blank())
RETURN
doesmatch

sshot-413.png

So total is 4, which is correct at an Item No-Description level, But INCORRECT when adding column for Customer ID.  Correct total should be 430.  Each customer/item combination where Budget ='s Forecaset should be 1 and the total (customer/item) would total 430.

 

Hope this is sufficient to get some feedback on the correct pattern.

 

As Always, appreciate the help.

 

Spencer

1 ACCEPTED SOLUTION
spencer_II
Helper I
Helper I

So here is the fix...  Two seperate tables requires the SUMMARIZE to be used w/ BOTH Filter context and SUMX.

Like the following:

SUMX(
FILTER(
SUMMARIZE('Tbl_Budget2020','Tbl_Customers DIM'[CUSTOMER],'Tbl_Product(ADJ) DIM'[Item No-Description]),
[Cnt Fcst equals Bdgt]=1),
[Cnt Fcst equals Bdgt])
This worked and returned the correct totals with columns from different dimension tables.

View solution in original post

1 REPLY 1
spencer_II
Helper I
Helper I

So here is the fix...  Two seperate tables requires the SUMMARIZE to be used w/ BOTH Filter context and SUMX.

Like the following:

SUMX(
FILTER(
SUMMARIZE('Tbl_Budget2020','Tbl_Customers DIM'[CUSTOMER],'Tbl_Product(ADJ) DIM'[Item No-Description]),
[Cnt Fcst equals Bdgt]=1),
[Cnt Fcst equals Bdgt])
This worked and returned the correct totals with columns from different dimension tables.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.