cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper I

## Dax formula results do not match

Hello,
I have difficulty. I created a DAX formula like this.

However, the results are not appropriate.
it should be that on 1 Feb 2024 the column "SisaNilaiKontrak"after deducting the value on 1 Jan 2024 should be worth 279.64.
(\$424.64 - \$145)

what should I change to the formula?

Thank you

1 ACCEPTED SOLUTION
Community Support

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) Click "transform data" to enter the power query and add a index column.

(3) We can createa measure and calculated columns.

``````Column =
CALCULATE(SUM('Contract'[Remaining Contract Value (USD)]),FILTER('SPK Plan',[No. Contract]=EARLIER('SPK Plan'[No. Contract])))-[Spk Plan ]``````
``Measure = CALCULATE(MAX('SPK Plan'[Column]),FILTER(ALL('SPK Plan'),[Index]=1))``
``````Column 2 = var _a=CALCULATE(SUM('SPK Plan'[Spk Plan ]),FILTER('SPK Plan','SPK Plan'[Index]<=EARLIER('SPK Plan'[Index])-1))
return  [Measure]-_a``````

(3) Then the result is as follows.

If the above one can't help you get the desired result, please provide your expected result with backend logic and special examples. Thank you.

Best Regards,

Neeko Tang

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

4 REPLIES 4
Community Support

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) Click "transform data" to enter the power query and add a index column.

(3) We can createa measure and calculated columns.

``````Column =
CALCULATE(SUM('Contract'[Remaining Contract Value (USD)]),FILTER('SPK Plan',[No. Contract]=EARLIER('SPK Plan'[No. Contract])))-[Spk Plan ]``````
``Measure = CALCULATE(MAX('SPK Plan'[Column]),FILTER(ALL('SPK Plan'),[Index]=1))``
``````Column 2 = var _a=CALCULATE(SUM('SPK Plan'[Spk Plan ]),FILTER('SPK Plan','SPK Plan'[Index]<=EARLIER('SPK Plan'[Index])-1))
return  [Measure]-_a``````

(3) Then the result is as follows.

If the above one can't help you get the desired result, please provide your expected result with backend logic and special examples. Thank you.

Best Regards,

Neeko Tang

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

Super User

what's the calculation logic?

pls provide the sample data (not the screenshot) and the expected output

Proud to be a Super User!

Super User

Try to create a measure instead of a calculated column.
If it doesn't help

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

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

Helper I

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors