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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
PbiCeo
Helper II
Helper II

How to get data from existing value on a new column according conditions

Hello everyone,

 

I've got a table like this:

Loc     Date                Type           Val        Price

TK2020/7/14Amount1,0001000
TK2020/7/14PT580
KT2020/7/14Amount900900
KT2020/7/14PT500

 

If Loc and Date are same, I want to get Val where Type is PT as the first value.

And for the second, I want to get Price where Type is PT.

The expected values as follows:

PT

58
0
50
0

 

How can I do that?

Thanks,

Vladi

3 REPLIES 3
harshnathani
Community Champion
Community Champion

HI @PbiCeo ,

 

Not very clear from what you have explained. 

 

Can you try explaining it a little better.

 

Where did you get 80 from ?

 

Regards,

Harsh Nathani

Sorry, it was just a mistake, not 80, but 50.

Hi @PbiCeo ,

 

You can create a Column

 

Column = 

IF('Table'[Type] = "Amount",
CALCULATE(MAX('Table'[Val]), FILTER('Table','Table'[Date] = EARLIER('Table'[Date]) && 'Table'[Loc] = EARLIER('Table'[Loc]) && 'Table'[Type] = "PT")),0)

 

1.jpg

 

Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors