Forum Discussion
Rana
10 years agoRegular Visitor
Difference between 2 columns
I have a Matrix in PowerBI which is showing data for 2 months (month is a string not a date column like Aug, Sept or any selected 2 months). Matrix shows me Total for both months, instead of Sum i ne...
- 10 years ago
@Rana,
A much cleaner code than the one posted by me before (and deleted) is the following:
PreviousDay = CALCULATE ( SUM (FactData[Employees]); Filter (ALL(FactData[Date]);FactData[Date]=Max(FactData[Date])-1) ) Difference = IF( ISBLANK([PreviousDay]); 0; SUM(FactData[Employees])-[PreviousDay] )
leonardmurphy
10 years agoSkilled Sharer
I don't know how that feature works in Tableau...but I can see why you'd want to do such a thing.
Even in Excel though, you'd have to do the calculation outside of a single pivot table, wouldn't you?
Perhaps an opportunity for a custom visualization (one that allows you to select & then does a side-by-side comparison of 2 selected dates/categories/other attributes)
Rana
10 years agoRegular Visitor
Yes in Excel it we created 3 pivot tables, 2 for each months and 3rd for differential. Can we do something similar in Power BI?