Forum Discussion
kunal_mehta1
Helper I
3 years agoDAX query or a different way
Hi all, I have a column which has all the project numbers which starts with C and starts with O. The few projects that starts with C also has the same last 4 numbers that start with O. I want a solu...
- 3 years ago
Hi,
I am not sure if I understood your question correctily, but please check the below picture and the attached pbix file.
Project new column CC = VAR _numberpart = RIGHT ( Data[Project], 4 ) VAR _Otable = FILTER ( Data, LEFT ( Data[Project], 1 ) = "O" && RIGHT ( Data[Project], 4 ) = _numberpart ) RETURN SWITCH ( TRUE (), LEFT ( Data[Project], 1 ) = "O", BLANK (), LEFT ( Data[Project], 1 ) = "C", IF ( COUNTROWS ( _Otable ) = 1, MAXX ( _Otable, Data[Project] ), "null" ) )
Jihwan_Kim
Super User
3 years agoHi,
I am not sure if I understood your question correctily, but please check the below picture and the attached pbix file.
Project new column CC =
VAR _numberpart =
RIGHT ( Data[Project], 4 )
VAR _Otable =
FILTER (
Data,
LEFT ( Data[Project], 1 ) = "O"
&& RIGHT ( Data[Project], 4 ) = _numberpart
)
RETURN
SWITCH (
TRUE (),
LEFT ( Data[Project], 1 ) = "O", BLANK (),
LEFT ( Data[Project], 1 ) = "C", IF ( COUNTROWS ( _Otable ) = 1, MAXX ( _Otable, Data[Project] ), "null" )
)
- kunal_mehta13 years ago
Helper I
Thanks Jihwan_Kim You're a LEGEND. Thanks for your quick response. It worked well.