Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
riadorra
Helper II
Helper II

Help with DAX Related with filter functions

Hi

 

I have 2 tables fEstoque and dCadastroProdutos and the are related many to one.

 

In fEstoque, i have a column named ULTIMA ATUALIZACAO and another named ULTIMA COMPRA 

 

What DAX formula should i use in order to bring to dCadastroProdutos the ULTIMA COMPRA values, but only the ones that have the text SIM at ULTIMA ATUALIZACAO column

 

thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello,

 

@riadorra, how does your table are structured? Can you show some data? Are the "ULTIMA ATUALIZACAO" "SIM" values unique for an given Product?

 

For example:

 

These are the table data:

image.pngimage.png

 

Like you can notice, for each product there is only one row containing the value "SIM". Am I right? 

 

These are my soltions for both calculated column and measure:

 

 

CALCULATE(FIRSTNONBLANK(fEstoque[ULTIMA COMPRA]; 0); fEstoque[ULTIMA ATUALIZACAO] = "SIM")

 

And this is a table visual:

image.png

 

 

Since that for Product C there is not a "SIM" valeu on fEstoque, the return value is blank.

 

But, if your data has more than one "SIM" value for each produtct I will need some more explanation.

 

Hope it helps!

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hello,

 

@riadorra, how does your table are structured? Can you show some data? Are the "ULTIMA ATUALIZACAO" "SIM" values unique for an given Product?

 

For example:

 

These are the table data:

image.pngimage.png

 

Like you can notice, for each product there is only one row containing the value "SIM". Am I right? 

 

These are my soltions for both calculated column and measure:

 

 

CALCULATE(FIRSTNONBLANK(fEstoque[ULTIMA COMPRA]; 0); fEstoque[ULTIMA ATUALIZACAO] = "SIM")

 

And this is a table visual:

image.png

 

 

Since that for Product C there is not a "SIM" valeu on fEstoque, the return value is blank.

 

But, if your data has more than one "SIM" value for each produtct I will need some more explanation.

 

Hope it helps!

 

Hi caaarlos,

 

yes, there's only 1 "SIM". it worked well.

 

I've tried another function and it worked too 

LOOKUPVALUE(fEstoque[data ultima compra];fEstoque[codigoproduto];dCadastroProdutos[Codnumero];fEstoque[ultima atualizacao];"sim")

 

Thank you very much

Riad

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.