Forum Discussion
hansreivers
1 year agoHelper I
Need help with with tabel Power Query
Hi all, We've got an excel with all items. This file is being refreshed automatically from our database. In our database, we have let's say 10 items with salesprice 500, costprice 500 and thus ...
- 1 year ago
Hi hansreivers TRy this
In Power Query, create a conditional column:
Margin = if [Article] = "x" then [Costprice] * 0.15 else 0In Power BI, add a calculated column:
TotalPrice = [Salesprice] + [Margin]Use a mapping table for dynamic updates, or a DAX measure:
DynamicMargin = IF(SELECTEDVALUE('Table'[Article]) = "x", SUM('Table'[Costprice]) * 0.15, 0)If this post helped please do give a kuods and accept this as a solution
Thanks In Advance - 1 year ago
Hi hansreivers Then you can add a log table with Article, Effective Date, and Increment columns. Load it into Power BI and create a dynamic margin measure using DAX:
DynamicMargin = VAR Increment = CALCULATE( MAX('LogTable'[Increment]), FILTER( 'LogTable', 'LogTable'[Article] = 'SalesTable'[Article] && 'LogTable'[Effective Date] <= 'SalesTable'[Date] ) ) RETURN 'SalesTable'[Costprice] * Increment
Akash_Varuna
1 year agoSuper User
Hi hansreivers TRy this
In Power Query, create a conditional column:
Margin = if [Article] = "x" then [Costprice] * 0.15 else 0
In Power BI, add a calculated column:
TotalPrice = [Salesprice] + [Margin]
Use a mapping table for dynamic updates, or a DAX measure:
DynamicMargin = IF(SELECTEDVALUE('Table'[Article]) = "x", SUM('Table'[Costprice]) * 0.15, 0)
If this post helped please do give a kuods and accept this as a solution
Thanks In Advance