Forum Discussion
Importing a data model from Excel to PowerBi: Different results for measures
Hi eod122 ,
In theory, it will be shown normally when we imporeted the model from Excel. And we use DAX to calculate both in Power BI and Excel. You can try the following formula firstly.
Customers who also bought the vear before =
var a = CALCULATE ( COUNTROWS ( Sales ) )
var b = CALCULATE (
COUNTROWS ( Sales );
FILTER ( ALL ( Date[Year] ); Date[Year] = MAX ( Date[Year] ) - 1 )
)
return
CALCULATE (
DISTINCTCOUNT ( Sales[CustomerID] );
Sales[Product] <> "Product3";
Customer[Group] = "Private";
FILTER (
VALUES ( Customer[CustomerID] );
a >0 && b > 0
)
)
If you can post a dummy file which we can test with that will help easier for us to solve it. If you can't, please post some sample data.
How to Get Your Question Answered Quickly
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- eod1227 years agoFrequent Visitor
Thanks for your reply!
I wasn't exactly able to solve it with the formula you suggested, however after playing around a bit I found that
"VALUES ( Sales[CustomerID])" instead of "VALUES ( Customer[CustomerID] )" did the job and delivered the expected results.
I'm fine with that but still struggle to understand why the formula is now giving the same results in PowerBi despite the difference to the original PowerPivot formula, and why the PowerpIvot formula creates unexpected results when being imported into PowerBi...