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
KM007
Helper II
Helper II

Select Start Price from Earliest Date

Hi

 

Please see attached photo.  

Create new column containing Start Price for each FundCreate new column containing Start Price for each Fund

I want to create a new Column that contains the Start Price for each of the Funds

Please may you let me know how to do this

Thanks!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

 @KM007

 

Try this Calculated Column using DAX

 

Start Price =
CALCULATE (
    FIRSTNONBLANK ( TableName[Price], 1 ),
    FILTER ( ALLEXCEPT ( TableName, TableName[Fund Name] ), TableName[Index] = 1 )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

 @KM007

 

Try this Calculated Column using DAX

 

Start Price =
CALCULATE (
    FIRSTNONBLANK ( TableName[Price], 1 ),
    FILTER ( ALLEXCEPT ( TableName, TableName[Fund Name] ), TableName[Index] = 1 )
)

Regards
Zubair

Please try my custom visuals

Thank you so much @Zubair_Muhammad

 

May I ask you to explain the formula, new to Power BI so learning the ropes

 

Thanks again!

HI @KM007

 

Here goes my effort to explain
I am not very good at it Smiley Tongue

 

1) Since this is calculated column.... calculation is done on a ROW by ROW basis.
2) The second argument of Calculate i.e.

 

FILTER ( ALLEXCEPT ( TableName, TableName[Fund Name] ), TableName[Index] = 1 )

 

is used to narrow the scope of computation. This returns a Table with a single row i.e. the Table row with the same Fund Name and where Index =1

3) Finallly the first argument of Calculate returns that PRICE VALUE for that single row

 

FIRSTNONBLANK ( TableName[Price], 1 )

 

You can alternatively use

 

VALUES( TableName[Price])

 

as well

 

FirstNonBlank helps pick a single value in case  Filter function returns more than one ROW

 

 


Regards
Zubair

Please try my custom visuals

Brilliantly explained - thanks!

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.