Forum Discussion
Getting different results in Excel and Power BI
cmn In this case power bi report is right then as you've applied date filter to 30-sep and there is only one segment against that date which is returned by power bi report.
Hi @ankitpatir. Thanks for your response, however the Power BI report is not right. The query is asking for the MTD values. Just because there was only one segment on 30th Sep doesn't change the fact that there was $200 worth of sales in the month for segments A and B. As I said, excel is doing the right thing.
As a further test, I created a very simple PBIX file with a very simple model consisting of the date table and an invoice table with the data shown in my original post. When I create a report against this model, PBI desktop is now doing the right thing. It is showing MTD values for all 3 segments. I have analysed the DAX being generated, and it is very different to that being generated against my on premise tabular model (SSAS 2014). I think the bug might be in the DAX that is generated against the old version of SSAS.
Here is the DAX generated using the PBIX model (using the latest DAX features)
DEFINE VAR __DS0FilterTable =
FILTER(
KEEPFILTERS(VALUES('Date'[Date])),
'Date'[Date] = DATE(2016, 9, 30)
)
EVALUATE
TOPN(
502,
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL('Invoice'[Segment], "IsGrandTotalRowTotal"),
__DS0FilterTable,
"MTD_Net_Revenue", 'Invoice'[MTD Net Revenue]
),
[IsGrandTotalRowTotal],
0,
'Invoice'[Segment],
1
)
ORDER BY
[IsGrandTotalRowTotal] DESC, 'Invoice'[Segment]and here is the DAX generated against my SSAS 2014 tabular model:
EVALUATE
TOPN(
501,
CALCULATETABLE(
ADDCOLUMNS(
KEEPFILTERS(
FILTER(
KEEPFILTERS(VALUES('Invoice'[Segment])),
NOT(ISBLANK('Invoice'[MTD Net Revenue]))
)
),
"MTD_Net_Revenue", 'Invoice'[MTD Net Revenue]
),
KEEPFILTERS(
FILTER(KEEPFILTERS(VALUES('Date'[Date])), 'Date'[Date] = DATE(2016, 9, 30))
)
),
'Invoice'[Segment],
1
)
ORDER BY
'Invoice'[Segment]- Anonymous9 years agoNot applicable