There are columns Date, Payer, SKU, A, B, C, Q1, Q2. Add calculated column ROI = (A-B)/C…
- User
There are columns Date, Payer, SKU, A, B, C, Q1, Q2. Add calculated column ROI = (A-B)/C for each unique combination of Payer, SKU, month and year component of Date. Use DAX expressions
- Assistant
To add a calculated column ROI using DAX expressions in Power BI, follow these steps:
- Open your Power BI report and go to the "Data" tab.
- Locate the table that contains the columns Date, Payer, SKU, A, B, C, Q1, and Q2.
- Right-click on the table name and select "Edit Query." This will open the Power Query Editor.
- In the Power Query Editor, select the "Add Column" tab and click on "Custom Column."
- In the "Custom Column" dialog box, enter a name for the new column, e.g., "ROI."
- In the "Custom column formula" box, enter the following DAX expression:
ROI = DIVIDE(([A] - [B]), [C]) - Click "OK" to apply the changes and close the dialog.
- Click "Close & Apply" in the Power Query Editor to load the updated data into Power BI.
The above steps will add a new column "ROI" to the table, which contains the calculated ROI values for each unique combination of Payer, SKU, and the month and year component of Date.
- User
No, ROI should be the same for each unique combination of Payer, SKU, month and year component of Date
- Assistant
Apologies for the misunderstanding. To add a calculated column ROI that is the same for each unique combination of Payer, SKU, month, and year component of Date, you can use the following DAX expression:
- Open your Power BI report and go to the "Data" tab.
- Locate the table that contains the columns Date, Payer, SKU, A, B, C, Q1, and Q2.
- Right-click on the table name and select "Edit Query." This will open the Power Query Editor.
- In the Power Query Editor, select the "Add Column" tab and click on "Custom Column."
- In the "Custom Column" dialog box, enter a name for the new column, e.g., "ROI."
- In the "Custom column formula" box, enter the following DAX expression:
ROI = DIVIDE(SUM(Table[A]) - SUM(Table[B]), SUM(Table[C])) - Click "OK" to apply the changes and close the dialog.
- Click "Close & Apply" in the Power Query Editor to load the updated data into Power BI.
The above steps will add a new column "ROI" to the table, which contains the calculated ROI values (using the SUM function) for each unique combination of Payer, SKU, month, and year component of Date.
- User
Your answer should be similar to that ROI(share, add%)_log2 = VAR SUM_GP = CALCULATE( SUM('Share16вед'[GP with share.byn]), ALLEXCEPT('Share16вед', 'Payers_clients'[Плательщик:#], 'Share16вед'[SCU Code], 'Share16вед'[Year], 'Share16вед'[Month])) VAR SUM_Log = CALCULATE( SUM('Share16вед'[Log with share.byn]), ALLEXCEPT('Share16вед', 'Payers_clients'[Плательщик:#], 'Share16вед'[SCU Code], 'Share16вед'[Year], 'Share16вед'[Month])) VAR SUM_Disc = CALCULATE( SUM('Share16вед'[Отгрузка по акции Discount, BYN]), ALLEXCEPT('Share16вед', 'Payers_clients'[Плательщик:#], 'Share16вед'[SCU Code], 'Share16вед'[Year], 'Share16вед'[Month]))
RETURN DIVIDE(SUM_GP - SUM_Log, SUM_Disc)
- Assistant
To add a calculated column "ROI(share, add%)_log2" using the given DAX expressions in Power BI, follow these steps:
- Open your Power BI report and go to the "Data" tab.
- Locate the table that contains the columns 'Share16вед', 'Payers_clients', 'Плательщик:#', 'SCU Code', 'Year', 'Month', 'GP with share.byn', 'Log with share.byn', 'Отгрузка по акции Discount, BYN'.
- Right-click on the table name and select "Edit Query." This will open the Power Query Editor.
- In the Power Query Editor, select the "Add Column" tab and click on "Custom Column."