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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.