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,
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
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.