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
CongPham
Helper I
Helper I

Help to Calculate target column base on Source Column and Target Column itself

Hi all,

I have some problem and dont know how to write DAX to get value at Target Column (pleass see the picture)

Anyone can help me to slove this?

Many thanks!

formula2.jpg

 

2 ACCEPTED SOLUTIONS
v-eachen-msft
Community Support
Community Support

Hi @CongPham ,

 

You could use POWER() function and SUMX() function to do it.

You need two measures:

Power =
VAR a =
    CALCULATE ( MAX ( 'Table'[No] ), ALLSELECTED ( 'Table' ) )
RETURN
    POWER ( 0.25, a - SELECTEDVALUE ( 'Table'[No] ) )
        * SELECTEDVALUE ( 'Table'[Value] )
Target =
VAR a =
    CALCULATE ( MAX ( 'Table'[No] ) )
RETURN
    ROUND (
        0.75
            * SUMX (
                FILTER ( ALLSELECTED ( 'Table' ), 'Table'[No] <= MAX ( 'Table'[No] ) ),
                [Power]
            )
            + POWER ( 0.25, a ) * 466,
        0
    )

Here is my result.

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Hi @CongPham ,

 

The trick is to find the regulation and establish a general formula. Please refer to the following image:

1-2.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

6 REPLIES 6
v-eachen-msft
Community Support
Community Support

Hi @CongPham ,

 

You could use POWER() function and SUMX() function to do it.

You need two measures:

Power =
VAR a =
    CALCULATE ( MAX ( 'Table'[No] ), ALLSELECTED ( 'Table' ) )
RETURN
    POWER ( 0.25, a - SELECTEDVALUE ( 'Table'[No] ) )
        * SELECTEDVALUE ( 'Table'[Value] )
Target =
VAR a =
    CALCULATE ( MAX ( 'Table'[No] ) )
RETURN
    ROUND (
        0.75
            * SUMX (
                FILTER ( ALLSELECTED ( 'Table' ), 'Table'[No] <= MAX ( 'Table'[No] ) ),
                [Power]
            )
            + POWER ( 0.25, a ) * 466,
        0
    )

Here is my result.

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

@v-eachen-msft  Many many thank
I got the true value I need, but I still don't understand your formula's meaning.
Could you give some advice?

Hi @CongPham ,

 

The trick is to find the regulation and establish a general formula. Please refer to the following image:

1-2.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Fowmy
Super User
Super User

@CongPham 

872 target should be for line no 3, please check

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Ahh, Sorry, I'm capturing it with excel. Please see the full picture:

formula2.jpg

 

@CongPham 

I am getting this:

Fowmy_0-1596009748979.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.