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
Anonymous
Not applicable

Reset weekly costs

Hey i have a little problem with server data. New cost entries in rows are summing even the previous rows value. Can someone help me with formula for measure that i could present the data with days/ month/ year in charts?

 

The values need to be reseted every month or the current month to be subtracted by previous. so i could present it normally ( that is the main problem). 

 

lukaszEltwin1_0-1665395111946.png

 

Current costs are calculated by taken smallest cost from each distinct id and subtracted by each counted new cost entrie

Current Cost =
'pl_master_data supla_sensor'[totalCost] - 'pl_master_data supla_sensor'[Constant value]

 

2 REPLIES 2
Anonymous
Not applicable

It returns the same values when i reseted everything to 0, just like in the column [Current Cost] The data will still contain value from previous rows. For example, Row 2276 needs to be subtracted by previous entry 2272. The calculation will give costs for inbetween  the minutes of both entries

 

lukaszEltwin1_0-1665475436024.png

 

v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

Here I suggest you to try this code to create a calculated column.

Current Cost =
VAR _Constant_Value =
    CALCULATE (
        MIN ( 'pl_master_data supla_sensor'[totalcost] ),
        ALLEXCEPT ( 'pl_master_data supla_sensor', 'pl_master_data supla_sensor'[ID] )
    )
RETURN
    'pl_master_data supla_sensor'[totalcost] - _Constant_Value

Result is as below.

RicoZhou_0-1665474000169.png

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
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.

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.