Forum Discussion
abdalla
4 years agoHelper I
Latest value
Hello, I want to make a column that holds the last shut in pressure-psia according to the latest active month date. I looked at other posts but cant seem to figure out the right code. Please...
- Anonymous4 years ago
Hi abdalla ,
Please try below dax formula to add a new column:
Column = VAR cur_active_month = 'Table'[Active Month] VAR cur_wellname = 'Table'[well name] VAR cur_well = 'Table'[Well] VAR cur_string = 'Table'[String] VAR cur_reservoir = 'Table'[Reservoir] VAR last_month = CALCULATE ( MAX ( 'Table'[Active Month] ), FILTER ( 'Table', 'Table'[Well] = cur_well && 'Table'[String] = cur_string && 'Table'[Reservoir] = cur_reservoir && 'Table'[well name] = cur_wellname ) ) RETURN CALCULATE ( MAX ( 'Table'[Shut in Pressure-psia] ), FILTER ( 'Table', 'Table'[Active Month] = last_month && 'Table'[Well] = cur_well && 'Table'[String] = cur_string && 'Table'[Reservoir] = cur_reservoir && 'Table'[well name] = cur_wellname ) )Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
4 years agoSuper User
abdalla , Refer if my blog can help
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.