Keep duplicate data in matrix visual Power BI - database

I'm facing an issue and hope you'll be able to help me.
I have a matrix with a lot of data and I've noticed that if a line have two same rows, Power BI brings them together immediately and sum the numbers.
Do you think that it's possible to tell Power BI do not summarize any row of the matrix?
Thank you.
Sample Screenshot:

The Power BI Matrix behaves similarly to the Excel Pivot Table, in which the aggregated data in the Values area is filtered by rows and columns: Double filter entries make little sense. However, this can be circumvented with a little workaround.
In PowerQuery select your table and add an index column via Add Column - Index Column
In the Power BI report view add this new index column to the Rows field of your matrix
In the formatting pane disable Word wrap for the Column headers and hide the index column by pulling the column width of the index column with the mouse to zero.
You can play around with the position of the index column to what looks best.
But as can be seen, this removes the aggregation in the Values area too.

Related

How to Subtract row by row in Power Bi?

In this dataset I am trying to develop a column or a measure based upon the hours column. I am trying to determine the difference between the first and second hour rows, the second and third hour rows, etc. and all the way through the entirety of the data.
Note: there are multiple serial numbers in this table; I just used this serial as an example.
I'm not sure this should be tagged with SQL-Server unless you can change the SQL that sources the data. If so you could pre-calculate this inside SQL Server.
If you can change the Power Query that brings the data into the data model you can add an Index column as the data's coming in and use that.
Please see:
How to Compare the Current Row to the Previous Row Using DAX

Finding difference between columns in column group

I am using report builder to create a report showing a budget for a project. The dataset includes line items for both budget and projected. See below for example rows. I am using a matrix with column group to display budget and projected side by side as well as a row group to show section, category, etc. I need to have a variance column that subtracts projected from budget.
I have scoured the interwebs for solutions but nothing that has worked so far. I feel like there has to be simple solution to this given it is something that could be done in a sql query with zero effort. Most solutions are assuming I have two separate fields, but these are dynamic fields pull out with the column group.
Dataset Row Samples
Type Section Cateogry Phase Task Total
Budget Building Kitchen Pre-Construction Cabinet Hardware $100
Projected Building Kitchen Pre-Construction Cabinet Hardware $220
Report sample
COL GROUP This is the column i want
Budget Projected Variance
+Buidling $100 $220 -$120
+Kitchen
+Pre-Con
EDIT: I tried the below solution without success and have already visited every link provided in the second answer. Maybe there is something I am missing, but I ended up just doing everything in the SQL query and not use Column groups. This is 100% the simplest solution. I am very surprised there is no easy way to reference individual columns in a column group. The below may work for others, but I just could not get them to work for me. Not sure why.
You could add an additional column inside the “Type” group (provided that this is the name of your column group). Set the Column Visibility to hide the column by an expression like
= IsNothing(Previous(Field!Type.Value, “Type”)
Calculate the values for that column as
= Previous(Sum(Fields!Total.Value), “Type”) – Sum(Fields!Total.Value)
That should calculate the difference between the values of the previous type and the current type, and
only show that column for the "Projected" type (when there is a previous type).
On the matrix, you can use the group subtotals to achieve this, you only have to overwrite the SUM operation with an expression that subtract to values. There are many link mentioning how to do that or that can helps you:
How to add calculated column from dynamic columns to a matrix
Adding subtotals to SSRS report tablix
How to write Expression to subtract row Group SubTotals
Reporting in SQL Server – Using calculated Expressions within reports

Displaying ready pivoted data in a graph - SQL Server Data Tools/BIDS

I have some ready pivoted data in SSRS that I wish to display as a graph, i.e. I have 13 columns (product and then one column for each month) and a values row below.
Because the data is 'pre pivoted' into columns rather than rows I'm struggling create a graph that displays as it would in excel, i.e. because each month is a column/field they are effectively different series in the graph, therefore the horizontal axis isn't as months, they are displaying as numbers (the chart data bars are fine).
Has anyone got any ideas with regards to how I could fix this?
Thanks
Jamie
Is this not what you want? Change the axis around using the series properties

How to build a column using data from another table with contraints

I have a very-badly done Excel Database that I have to repair. To do that, I need to get specific data from a table and put it in another table, if certain cells in each rows equals cells from rows in the first table.
Here is a screenshot to explain what I need.
I tried with advanced filters but I can't get it to work.
I got an answer.
The trick here is to use a vertical search (=VLOOKUP(cell; tableToSearch; cellToSearchLocation) and IF conditionning.
Sadly, my example isn't valid because the cell we search (in "hey" column) is a in a column before the "ho" and "hi" columns.
If anyone has any questions about this solution, feel free to ask.

SSRS How to "Unpivot" my pivotted table

I have an SSRS sub report that is dynamically retrieving from different tables based on auctioning different cells. In order to do this, I pivot the tables at the sql server end using dynamic sql in a procedure.
When it gets into SSRS it obviously looks like this.
Field Value
Product Dining Table
Length 1.2m
Width 1m
Height 0.9m
Colour Brown
Product Bench
Length 2m
Width .4m
Height 0.6m
Colour White
Is there a clever way to "unpivot" the table in SSRS so that I get it like so.
Product Length Width Height Colour
Dining Table 1.2m 1m 0.9m Brown
Bench 2m .4m 0.6m White
I've tried using a matrix but I can't figure out a way to do it.
Thanks.
Here only thing missing is to get unique ID along with SQL result set, then that field is used in Row Grouping.
You can refer to similar post Add the columns automatically in SSRS report posted by me

Resources