The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have the below table and want to create a column that has the first value of weight (152.6) for every row. I plan on using this to create another measure that shows % increase decrease over time
What is the easiest way to do this?
Thanks for your help
Date | Time | Weight |
1/29/2023 | 11:59:00 AM | 152.6 |
1/29/2023 | 6:44:00 PM | 153 |
1/30/2023 | 7:48:00 AM | 152.8 |
1/30/2023 | 8:45:00 PM | 151.4 |
1/31/2023 | 6:34:00 AM | 150.8 |
Solved! Go to Solution.
Hi,
Write these calculated column formulas
Date time = Data[Date]+Data[Time]
First weight = LOOKUPVALUE(Data[Weight],Data[Date time],CALCULATE(MIN(Data[Date time]),ALL(Data)))
Hope this helps.
You are welcome.
Hi,
Write these calculated column formulas
Date time = Data[Date]+Data[Time]
First weight = LOOKUPVALUE(Data[Weight],Data[Date time],CALCULATE(MIN(Data[Date time]),ALL(Data)))
Hope this helps.
Hi,
You could try something like this. Although I would suggest linking the "earliestWeight" to "Time" column, so you get the true first value, rather than just the minimum results from the "Weight" column.
Average Weight =
VAR earliestWeight = CALCULATE (
MIN ( 'Table'[Weight] ),
FILTER ( 'Table', 'Table'[Date] = MIN ( 'Table'[Date] ) )
)
RETURN CALCULATE(AVERAGE( 'Table'[Weight]), ALLEXCEPT('Table','Table'[Date])) / earliestWeight
This is my desired output in column D and how I would write it in excel:
Hi,
you can try
Column D is my desired output and how I would write it in excel:
@rbpercussion Try:
Column = MINX(ALL('Table'),[Weight])
Hi @Greg_Deckler ,
That returns the minimum weight for the table. What I am trying to return is the weight that corresponds to the earliest date