Forum Discussion
Calculate Max date by filter two columns
- 5 years ago
Hi, Saxon10
Please check the below-updated link that includes the calculated column.
https://www.dropbox.com/s/hjra12fkfkixrvl/saxon10.pbix?dl=0
Max Date new column =
VAR countriescondition =
SUMMARIZE ( FILTER ( Data, Data[ITEM] = Report[ITEM] ), Data[COUNTRY] )
VAR newtable =
FILTER (
Data,
Data[ITEM] = Report[ITEM]
&& Data[COUNTRY]
IN { "INDIA", "US", "UK", "NEWL" }
&& Data[AREA CODE] IN { "A" }
)
RETURN
IF (
COUNTROWS ( countriescondition ) >= 4,
MAXX ( newtable, Data[DATE] ),
BLANK ()
)If you write calculated measure, the table visualization already has the filter for the item, so I did not mention the item column in the calculated measure.
However, as you can see in the calculated column, I had to mention the item column.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Hi, Saxon10
Please check the below measure and the sample pbix file's link whether it is what you are looking for.
https://www.dropbox.com/s/hjra12fkfkixrvl/saxon10.pbix?dl=0
Max Date =
VAR countriescondition =
VALUES ( Data[COUNTRY] )
VAR newtable =
FILTER (
Data,
Data[COUNTRY]
IN { "INDIA", "US", "UK", "NEWL" }
&& Data[AREA CODE] IN { "A" }
)
RETURN
IF ( COUNTROWS ( countriescondition ) >= 4, MAXX ( newtable, Data[DATE] ), "" )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
- Saxon105 years ago
Post Prodigy
Thanks for your reply and help. I will check and come back to you.
I am looking for New calculate column option can you please advise How can I get that.
- Saxon105 years ago
Post Prodigy
Hi,
Thanks for your reply.
Your solution working well. I would like to get the same result by using New calculated column.
Can you please advise me why the item column not mentioned in your measure? How it pick actual result without item column range?
Herewith attached the PBI file for your reference. (Data and report file)
https://www.dropbox.com/s/prtdxmt7whfr8kc/saxon10.pbix?dl=0
- Jihwan_Kim5 years ago
Super User
Hi, Saxon10
Please check the below-updated link that includes the calculated column.
https://www.dropbox.com/s/hjra12fkfkixrvl/saxon10.pbix?dl=0
Max Date new column =
VAR countriescondition =
SUMMARIZE ( FILTER ( Data, Data[ITEM] = Report[ITEM] ), Data[COUNTRY] )
VAR newtable =
FILTER (
Data,
Data[ITEM] = Report[ITEM]
&& Data[COUNTRY]
IN { "INDIA", "US", "UK", "NEWL" }
&& Data[AREA CODE] IN { "A" }
)
RETURN
IF (
COUNTROWS ( countriescondition ) >= 4,
MAXX ( newtable, Data[DATE] ),
BLANK ()
)If you write calculated measure, the table visualization already has the filter for the item, so I did not mention the item column in the calculated measure.
However, as you can see in the calculated column, I had to mention the item column.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
- Saxon105 years ago
Post Prodigy
Thanks for your reply and help. Your solution working well.