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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
tfraletti
Helper I
Helper I

Not being able to get the value from the first date

Hi,

 

I'm trying to get the value from the first date of a stock. This is the first step in order to compute the variation between today and first day of the series (so the formula bellow is the denominator). The problem is i'm not being able to ignore the filter context provided by the visual on the date column, so i'm getting the row level value everytime. Can someone help me pointing what am i doing wrong?

 

first_day_value = 
CALCULATE(
    AVERAGE('yahoo finance'[close]),
    FILTER(
        ALL('yahoo finance'[date]),
        MIN('yahoo finance'[date])
    )
)

 

Capturar.PNG

 

1 REPLY 1
rfigtree
Resolver III
Resolver III

i must have deleted my first post, doing again.

the Min function will be scanning the original data model context, not the whole thing as you aree expecting.

I would do this.

 

var FirstDate=

calculate(min(table[date]),all(table))

return calculate(average(table[close]),filter(all(table),table[date]=FirstDate))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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