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.
I am trying to input a formula or query that can do the following:
Before 30/06/2019 0:00pm multiply units by price multiply by OLD factor in a lookup table.
After 30/06/2019 0:00am or from 01/07/2019 0:30am multiply units by price multiplied by a NEW factor in the lookup table.
currently i have the following Measure:
Solved! Go to Solution.
Hi @wvdmedify ,
We can create a measure as below.
GSF Net Production = VAR k = FILTER ( Gannawarra, 'Gannawarra'[date] <= ( DATE ( 2019, 06, 30 ) + TIME ( 24, 0, 0 ) ) ) VAR b = FILTER ( Gannawarra, Gannawarra[date] >= ( DATE ( 2019, 06, 30 ) + TIME ( 24, 0, 0 ) ) && 'Gannawarra'[date] <= ( DATE ( 2019, 07, 01 ) + TIME ( 0, 30, 0 ) ) ) RETURN CALCULATE ( SUM ( Gannawarra[kWh] ), KEEPFILTERS ( k ) ) * CALCULATE ( MAX ( MLFs[DLF] ), FILTER ( MLFs, MLFs[Solar Farm] = "Gannawarra" ) ) + CALCULATE ( SUM ( Gannawarra[kWh] ), KEEPFILTERS ( b ) ) * CALCULATE ( MAX ( MLFs[DLF New] ), FILTER ( MLFs, MLFs[Solar Farm] = "Gannawarra" ) )
Hi @wvdmedify ,
We can create a measure as below.
GSF Net Production = VAR k = FILTER ( Gannawarra, 'Gannawarra'[date] <= ( DATE ( 2019, 06, 30 ) + TIME ( 24, 0, 0 ) ) ) VAR b = FILTER ( Gannawarra, Gannawarra[date] >= ( DATE ( 2019, 06, 30 ) + TIME ( 24, 0, 0 ) ) && 'Gannawarra'[date] <= ( DATE ( 2019, 07, 01 ) + TIME ( 0, 30, 0 ) ) ) RETURN CALCULATE ( SUM ( Gannawarra[kWh] ), KEEPFILTERS ( k ) ) * CALCULATE ( MAX ( MLFs[DLF] ), FILTER ( MLFs, MLFs[Solar Farm] = "Gannawarra" ) ) + CALCULATE ( SUM ( Gannawarra[kWh] ), KEEPFILTERS ( b ) ) * CALCULATE ( MAX ( MLFs[DLF New] ), FILTER ( MLFs, MLFs[Solar Farm] = "Gannawarra" ) )
Thanks for your response, i still seem to obtain the same value from my version to yours. the only problem both do not agree to the amount we should invoiced.
Think it as some thing to do with the Date filter.
Got it, just changed the dates around, solution works. Thanks!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.