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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Tux-CM
Frequent Visitor

Get the First value of my table and Get it in a measure

Please, your support. I am trying to obtain the value of the first day in this table. You always have 15 days and you want to obtain the value of the first day in one measure. I do it in the following way: 

 

TuxCM_0-1646606304447.png

Thank you very much in advance.

1 ACCEPTED SOLUTION

Hi @Tux-CM ,

 

ALLSELECTED() just remove the column you specailed. For the context of each row in your matrix table when you add [Categoria] to this viausl, another filter affect this filter context of this row, so, please also remove the filter comes from [Categoria], like REMOVERFILTER('Quiebre_8S'[Categoria]) in var _date.

 

Or try this code:

measure =
VAR _date =
    CALCULATE ( MIN ( 'Quiebre_8S'[Fecha] ), ALL () )
RETURN
    CALCULATE (
        [Prom Valorizado L2W],
        FILTER ( ALLSELECTED ( 'Quiebre_8S'[Fecha] ), [Fecha] = _date )
    )

 

Best Regards!

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
johnt75
Super User
Super User

You could use TOPN to get the values for the earliest date, the basic idea would be

Val Min = SELECTCOLUMNS( TOPN(1, 'Table', 'Table'[Sort Column], ASC), "@val", 'Table'[Value Column] )
ValtteriN
Super User
Super User

Hi,

The basic pattern for getting first values from visible dates is like this:

Measure = var _date = calculate(MIN(Aggregation[Opened At]),ALLSELECTED(Aggregation[Opened At]))
//Here we get the earliest date available from the visible dates
return

CALCULATE(SUM(Aggregation[Duration(Secs)]),ALL('Aggregation'),Aggregation[Opened At]=_date)

Example:
ValtteriN_0-1646632352156.png



I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







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

Proud to be a Super User!




Hi @ValtteriN ,, the formula you provide me does not calculate correctly:TuxCM_0-1646634006912.png

The formula that it provides me only works if it does not have several columns, that is why I use the following formula but it does not perform the correct calculation:

TuxCM_2-1646634716165.pngValMin =CALCULATE(SUMX(ALLSELECTED(Quiebre_8S[Fecha]),[Prom Valorizado L2W]),Quiebre_8S[Ranking]=1)

Thanks in advance.

Hi @Tux-CM ,

 

ALLSELECTED() just remove the column you specailed. For the context of each row in your matrix table when you add [Categoria] to this viausl, another filter affect this filter context of this row, so, please also remove the filter comes from [Categoria], like REMOVERFILTER('Quiebre_8S'[Categoria]) in var _date.

 

Or try this code:

measure =
VAR _date =
    CALCULATE ( MIN ( 'Quiebre_8S'[Fecha] ), ALL () )
RETURN
    CALCULATE (
        [Prom Valorizado L2W],
        FILTER ( ALLSELECTED ( 'Quiebre_8S'[Fecha] ), [Fecha] = _date )
    )

 

Best Regards!

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Tux-CM  That seems quite odd,

What kind of aggregation do you use for [Stock_valorizado] in your example? I suspect that there might be more values for 19.2.2022 and for that reason the result returned is too large. 

The easy way to troubleshoot these kind of measures is to comment out parts of the measure (e.g. here I check if the date returned in the variable is the correct one):


ValtteriN_0-1646635588873.png

 








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

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.