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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.