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

Multiply a result for a value in other column

Hello, I really need help to find a dax function that multiplay result for a value in other column and go consecutive...

for example:

A1 = B1

B1 x A2 = B2

B2 x A3 = B3

B3 x A4 = B4

 

Bremaciel_0-1628102317547.png

 

Please and Thank you!!

4 REPLIES 4
wdx223_Daniel
Super User
Super User

say, you have a column that index each rows, such as 1,2,3....

B=PRODUTX(FILTER(Table,Table[Index]<=EARLIER(Table[Index])),Table[A])

V-pazhen-msft
Community Support
Community Support

@Anonymous 


You cannot do calculation to change the existing column using DAX. You may only add another column C to have the result but you don't have column B without the calculation. So I am pretty sure you can not achieve this with DAX. 

 

 

Paul Zheng _ Community Support Team
Best Regards

 

 

 

Jakinta
Solution Sage
Solution Sage

You can try this in new blank query and adjust according to your needs.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtCztLQ0N1aK1UFlG8JFLAwt4GxzExM428wESZehpVJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    Type = Table.TransformColumnTypes(Source,{{"Column1", type number}}),
    NewColumn = Table.FromColumns( {Type[Column1], List.RemoveFirstN(List.Accumulate(Type[Column1],{1}, (s,c)=> s &  {List.Reverse(s){0}*c}), 1)}, {"A","B"}),
    FINAL = Table.TransformColumnTypes(NewColumn,{{"A", Percentage.Type}, {"B", Percentage.Type}})
in
    FINAL

Jakinta_0-1628123552341.png

 

Anonymous
Not applicable

@Jakinta Thank you, how can I use this query as a new measure? 

Bremaciel_0-1628173990345.png

Bremaciel_1-1628174005758.png

I'm using measure for values in A and need the DAX function to figure out values in B

 

Please and thank you!

 

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.

Top Solution Authors
Top Kudoed Authors