Forum Discussion
peterhui50
4 years agoHelper III
Subtraction using the same column
Hi, I have a table here, in Power BI, I am using a table visual, Test_A and Test_B are measures and Test_C is a subtraction both. but basically I want it to do this.. I want the...
- 4 years ago
Hi peterhui50
try this
Test_C = VAR _date1 = DATE ( 2020, 3, 31 ) VAR _date2 = DATE ( 2021, 3, 31 ) VAR _value1 = CALCULATE ( MIN ( 'Table'[Units_Sold] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Company] ), 'Table'[Date] = _date1 ) ) RETURN IF ( MIN ( 'Table'[Date] ) = _date1, MIN ( 'Table'[Units_Sold] ), IF ( MIN ( 'Table'[Date] ) = _date2, MIN ( 'Table'[Units_Sold] ) - _value1, BLANK () ) )result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
parry2k
4 years agoSuper User
peterhui50 send the pbix file, remove sensitive information before sharing, use one drive/google drive for sharing.