Forum Discussion
ghost10
3 years agoFrequent Visitor
Range end close price
Hi Team , I am working working on some power bi reports. Actually I want to know how can we derive close end price for the perticular month based on id and date. using dax only.
- Anonymous3 years ago
Hi ghost10 ,
Due to I don't know your data model, I create a sample to have a test.
My Sample:
YearMonth is a calcualted column.
YearMonth = YEAR([Date])*100+MONTH([Date])Measure:
Range end close price = CALCULATE ( SUM ( 'Table'[Price] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[ID], 'Table'[YearMonth] ), 'Table'[Date] = MAX ( 'Table'[Date] ) ) )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi ghost10 ,
Due to I don't know your data model, I create a sample to have a test.
My Sample:
YearMonth is a calcualted column.
YearMonth = YEAR([Date])*100+MONTH([Date])
Measure:
Range end close price =
CALCULATE (
SUM ( 'Table'[Price] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[ID], 'Table'[YearMonth] ),
'Table'[Date] = MAX ( 'Table'[Date] )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.