cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Ovidijus
Frequent Visitor

Date time subtraction

Hello Pbix`ers,

 

Struglling with measure creation.

 

Have two subtract value lik ein picture?

 

Ovidijus_0-1685619115048.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@Ovidijus , Try like

 

new measure =
var _max = maxx(filter(allselected(Table), Table[Meter Number] = max(Table[Meter Number]) && Table[Date] < max(Table[Date])), Table[Date] )
return
sum( Table[Value]) - sumx(filter(allselected(Table), Table[Meter Number] = max(Table[Meter Number]) && Table[Date] = _max), Table[Value] )

 

 

or

 

new measure =
var _max = maxx(filter(allselected(Table), Table[Meter Number] = max(Table[Meter Number]) && Table[Date] < max(Table[Date])), Table[Date] )
return
sum( Table[Value]) - sumx(filter((Table), Table[Date] = _max), Table[Value] )

Hey, solution probably would work but i played a little yesterday and need this visual as in the top table.

 

Need to see calculated values from Meters minus 12 hours.

 

That would be massive help to solve 🙂

 

Ovidijus_0-1685689000809.png

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors