How to add a subtotal row to existing data in power bi - powerbi

Can anyone help me add a subtotal row to existing data in power bi. Please see the sample output on the above snip.

If you're looking to add a subtotal to your matrix visualization in the report itself, you should use the paintbrush or customization icon on the frontend instead. There you're able to toggle subtotals and grand totals for both rows and columns. However, if it's important to have your backend data display the subtotal row, you can use M code in Power Query to "groupby" a column and summarize your data. See these links for sample code that have different techniques:
https://social.technet.microsoft.com/Forums/en-US/1891afde-7392-4d27-b920-dfd579837dc8/how-to-add-subtotal-in-a-row-in-power-query?forum=powerquery
https://community.powerbi.com/t5/Power-Query/Calculate-Subtotals-based-on-column-value-in-Power-Query-M/td-p/791788

Related

Add Manual Formulas in Power BI Table Visualization

Is it possible to perform calculations based off of the Table Visualization's values? I understand Power BI has the option manually add columns in the data set but that will not work in this example because of how the data is aggregated.
Basically, I would want the option to create a formula next to revenue where I would divide revenue by cost.
enter image description here
As has been mentioned, a measure would be the solution. Something like the following
Measure = DIVIDE(CALCULATE(MAX(Table[Revenue])), CALCULATE(MAX(Table[Cost])), 0)

POWER BI how to add different tooltips for each column in table visualisation

I want to add in a table visualisation in POWER BI different Tooltips.
Each column of my table return sum(quantity) by date. I want to add the tooltips for each column to show details of the quantity. Taking into consideration the date of the current column.
Can you please help me? Thank you

Split payment method column into two columns in Power BI

I have data which has a Payment Method, containing Advance and Royalty in rows. I want to split that in two columns Advance and Royalty.
This is my sample data:
I would like the output as attached in Power BI:
Welcome to Stack Overflow! Next time do not post your sample data as images, please!
You can add columns to your model in different ways - to add a conditional column or a custom column with M in Power Query Editor, or to add a calculated column or measure with DAX. In this case I will recommend you to add two conditional columns. Click on Transform data button in the ribbon to open Power Query Editor and then from Add Column tab click Conditional Column. Name it Advance, select Payment Method to be Advanceand set the output to beAdvance`:
Do the same again, but this time for Royalty payment type:
And you will get the desired result:

Power BI matrix row level aggregations

Please I have 2 row levels on my matrix visual and I am trying to modify the aggregation of the first row
level to show average of the data on the second level. please find picture below.
any assistance will be appreciated
enter image description here
In the list of Values fields in the matrix, right click Total Days present (Att) and change the aggregation from Sum to Average:
And at group level (and total level) you will see averages:
For more information take a look at Work with aggregates (sum, average, and so on) in the Power BI service article.

how to get monthly and yearly totals using dax

I'm kind of new to the power bi. I want to calculate the monthly yearly totals from the column Amount and TRD_date column. Please see the below data
The solution does not require DAX. You can do this easily in Power Bi Report Desktop. Just follow these steps:
Step 1- create a new Report and on a blank report, click the Table visual (show highlighted in yellow below)
Step 2- Bring in your datasource and drag over to the Values area of the visual, the Date column first, then the Amount column second. Your values will look like:
Step 3- Remove (click the X) for the Date-> Quarter Value and Date-> Day value. This will total the amounts for you by Month and Year.
Your table will be a shown below:
My data is shown here for reference: