Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello
I'd like to know how to see the last value of one column filtering by others. I paste sample table.
Before:
ID0 | ID1 | Question | Answer |
8 | AAAVTUHJ | A | 0 |
7 | AAAVTUHJ | A | 0 |
6 | AAAVTUHJ | A | 1 |
5 | AAAVTUHJ | B | 1 |
4 | AAAVTUHJ | B | 1 |
3 | AAAVTUHJ | B | 1 |
2 | AAAVTUHJ | C | 1 |
1 | AAAVTUHJ | C | 0 |
After:
ID0 | ID1 | Question | Answer | NewColumn |
8 | AAAVTUHJ | A | 0 | 0 |
7 | AAAVTUHJ | A | 0 | |
6 | AAAVTUHJ | A | 1 | |
5 | AAAVTUHJ | B | 1 | 1 |
4 | AAAVTUHJ | B | 1 | |
3 | AAAVTUHJ | B | 1 | |
2 | AAAVTUHJ | C | 1 | 1 |
1 | AAAVTUHJ | C | 0 |
Greetings and thanks in advance,
Xavi
Solved! Go to Solution.
Hi @Syndicate_Admin ,
Please refer to the formulas.
//If you want a measure
Measure 4 =
VAR x =
MAXX(
FILTER( ALL(Sheet7), [ID1] = MAX([ID1]) && [Question] = MAX([Question]) ),
[ID0]
)
RETURN
CALCULATE(
MAX(Sheet7[Answer]),
FILTER(
Sheet7,
Sheet7[ID0] = x
)
)
If you want a calculated column.
// If you want a column
Column =
VAR x =
MAXX(
FILTER( Sheet7, [ID1] = EARLIER([ID1]) && [Question] = EARLIER(Sheet7[Question]) ),
[ID0]
)
RETURN
IF(
[ID0] = x,
[Answer], BLANK()
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syndicate_Admin ,
Please refer to the formulas.
//If you want a measure
Measure 4 =
VAR x =
MAXX(
FILTER( ALL(Sheet7), [ID1] = MAX([ID1]) && [Question] = MAX([Question]) ),
[ID0]
)
RETURN
CALCULATE(
MAX(Sheet7[Answer]),
FILTER(
Sheet7,
Sheet7[ID0] = x
)
)
If you want a calculated column.
// If you want a column
Column =
VAR x =
MAXX(
FILTER( Sheet7, [ID1] = EARLIER([ID1]) && [Question] = EARLIER(Sheet7[Question]) ),
[ID0]
)
RETURN
IF(
[ID0] = x,
[Answer], BLANK()
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syndicate_Admin ,
Create the followng calculated column as follows:
Hello
When I apply this formula the result is as follows:
For example, values 1 do not appear in the Output column
The formula is as follows (the table is called Label Oil)
Hi,
Question and Answer are a different columns.
Hi @Syndicate_Admin ,
Ok they are different columns I understand. But the output is right based on the requireemnt.
Thanks,
Pragati
@Syndicate_Admin , Create a new column
new column =
var _1 = countx(filter(Table, [ID1] =earlier[ID1] && [Answer] =0),[ID1])+0
var _2 = MinX(filter(Table, [ID1] =earlier[ID1] ),[ID0])
return
if([ID0] =_2 ,if(_1>0 0, 1),blank())
Hi,
When you writte "á" "?", what does a mean?
Regards,
Xavi
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.