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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Using key from fact and dim gives different results

I have this measure:

 

VAR V1=
ADDCOLUMNS(
VALUES (Fact[Key_Customer] ), 
"C1",             
CALCULATE([RevenueYTD],SAMEPERIODLASTYEAR('Date'[Date]),REMOVEFILTERS(Fact[Segment],Fact[Type])
)  
)

RETURN SUMX(V1, [C1])

 

And I wanted to change it to:

VAR V1=
ADDCOLUMNS(
VALUES (Customer[Key_Customer] ), 
"C1",             
CALCULATE([RevenueYTD],SAMEPERIODLASTYEAR('Date'[Date]),REMOVEFILTERS(Fact[Segment],Fact[Type])
)  
)

RETURN SUMX(V1, [C1])

 

But returns wrong totals, why is this? What difference does it make? Customer[Key_Customer] and Fact[Key_Customer] are the same…

 

 

To give some context:

(In the Customers table I have Customers with the exact same names, but different Key_Customer, they are in fact different customers, they just happen to have the same name).

 

My problem is that I have a Filter in the report as: Customer[Name]… and Power BI groups by name, ignoring the Key.

 

My goal is to change the code to have: VALUES (Customer[Key_Customer] )

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Plot the first with Fact Key_customer

and second, one customer Key_customer, are you still seeing the same diff? 

 

 

Make sure customer as all the customer in fact.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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