Power BI: Losing precision by using SUMMARIZECOLUMN? - powerbi

I am new to Power BI and I am making a matrix for Sales value. As we use various currencies and convert the numbers, each Sales number can have as many as 15 decimal points. NumericColumn corresponds to Sales going forward.
There is this OriginalTable:
NumericColumn,
OtherColumn1,
... ,
OtherColumnN
This OriginalTable is imported from SQL Server and has ~ 400K rows. NumericColumn has type numeric(35,15).
As there are a lot of unimportant columns in OriginalTable I made a new table in the following manner where M << N:
NewTable = SUMMARIZECOLUMNS(
OriginalTable[NumericColumn],
OriginalTable[OtherColumn1],
... ,
OriginalTable[OtherColumnM]
)
The sum of the "NumericColumn" in OriginalTable is 2,550,832.98 . This number is seen by putting "NumericColumn" in Value field as Sum and without setting any Rows or Columns in Visualization -> Matrix.
On the other hand, the sum of the "NumericColumn" in NewTable is 2,550,829.14 (3.84 smaller than that in OriginalTable).
It seems that I lost precision when I created a new table. Would somebody kindly take a look? Please let me know if more information is needed.
Thanks & Regards,
Kyoto

By default, the M query transformation keeps up to 8 decimal points when you are importing data and applying Change Type. As you said you have up to 15 decimal points, you can try the below steps and check it worked for you or not.
Come back to report clicking Cloase & Apply button. Now in the report, select your decimal value column configure the column Format and Decimal points as shown below-
Now applying SUMMARIZECOLUMNS should give your expected result.

Related

How do I create an Other category in PowerBI Desktop?

I am learning Power BI Desktop. I have a project already loaded for which I have created a
pie chart.
As you can see, the data is currently divided into two years: 2022 and 2021.
I also have data for previous years that I want to include in the chart. Unfortunately, none of these years has a high number. So I want to group them all into an "Other" category.
I've already tried using the RANKX function as described here (where I copied and pasted the formula from the comment and replaced the field name with my own) and here (where I went through the article step by step using my own field names). I used the exact format shown in both the comment and the article:
Rank = RANKX('Table','Table'[Percent],,DESC,Dense)
(Table is the table name I am using and Percent is the column I am trying to rank.)
When I added the new column to a table, though, PowerBI automatically gave me a sum calculation. This calculation gave me a 1 in each column. When I asked it not to give me a sum, it said it could not display the visual and took me back to the calculation screen.
EDIT: Thanks for your help Kevin! This is the table I tried to draw from. I am an idiot sometimes.
EDIT 2: Now I am trying to use a different field in the formula:
Rank = RANKX('FactClaimActivity','FactClaimActivity'[DirectIncurredLoss_ITD])
(This is the original field that I tried to base Percent on)
My table looks like this. (Yes, I know that 2016, 2017, 2019 and 2020 have negative values and 2014 and 2015 have $0 values. I just want to show what the data is.)
EDIT 3: This time I am also getting an error when I type in the formula, which says "A single value for column 'DirectIncurredLoss_ITD' in table 'FactClaimActivity' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
I do not understand why it wants a single result for a formula that ranks the data points based on this field. That seems like it defeats the whole purpose of the formula.
Yet when I use the formula, I get the same result as last time! This column is in the Fixed decimal number format, and it does have many different values.
EDIT: I've found the answer
New Category = IF('FactClaimActivity'[Rank]<=2,'FactClaimActivity'[LossYear],"Other")
The formula will help you get the correct result.

Table rounds up values to whole numbers even though data type in tables is decimal

The DynEff column is a measure I created which simply sums the refCalculations[StdHrs] column. However, for some reason the table is rounding off the values to whole number. In PQ, the column type is decimal. In the Data view in PBI as well, the type is decimal. But for some reason when I add the measure to the table, values get displayed as whole numbers!
I know the values are correct. Is this just a display issue? I have other measures in the table with simple sum formulas that don't get rounded off. For example, DynLbs is also a simple sum and I get the correct value, with decimals!
Any help would be greatly appreciated. Thank you!
Solved:
In Report View, select the field in question, Column Tools, you will see a Formatting group where you can choose the correct formatting.

Power BI: Return sum of numerical data for each counterparty and its several currencies between two dates and its variation

I need your help regarding Power BI because I'm quite new with it. I'm struggling to compute and show what I want.
I have imported my table from a database.
What I want is to compute the sum of the Nominal for each Counterparty and each Currency, BUT it needs to respect the condition: start date <= date in the date table & end date > date in the date table. At the end, I want to show the result just like the last image, a dynamic table.
Moreover, after computing the sum of the nominal, I need to compute the difference between two dates and the % variation of it.
On my side, I was able to get the sum I want but the problem is I created columns for each counterparty and currency like 'AZE EUR', 'AZE USD', in the Date table.
BY doing this, I can't create a pie chart that defines the % of EUR or USD owned by AZE and HUB counterparties. So no dynamic chart.
I hope I was clear enough. If not let me know :)
Thank you in advance for all your helps.
NB: if the image can't be seen, let me know.

Calculated field Sub total in pivot table is not displaying correct value

I am working on QuickSight in AWS. I am trying to achieve weighted average value in a Pivot table.
I am using SPICE data to create this analysis.
I have created a calculate field (WAM) in analysis with formula "percentOfTotal(sum(upb),[{pool_num}]) * sum({remaining_terms})".
This gives me the desired value on each row level, but the sub total of a particular column is not reflecting the total of values in the calculate field, rather it displays the sum of original values in the "remaining_terms" field.
Please see below image for the same. Can some one please through some light on this ?
Thanks in advance for your help
Please note that I have tried the same in Excel pivot table and it works perfectly.
Try to remove the 2nd argument from the percentOfTotal function. For example, just do:
percentOfTotal(sum(upb))
I am not 100% this will work but one thought it that it would match the remaining_terms value if the percentageOfTotal was 1 (i.e. 100%) and you may not need to provide a partition argument in a pivot table since pivot tables implicitly provide partitions.
I have solved the problem in a different way. See below what I have done.
WAM = percentOfTotal(sum(upb),[{pool_num}]) * sum({remaining_terms}).
It looks like QuickSight treats the subtotal as a row and the above function is applied on the subtotal, hence it is converted as
(1186272.5 / 1186272.5) * 31 = 31.
I have tried to produce the desired result by introducing another custom field with formula
SUM_WAM = sumOver({WAM},[{pool_num}]).
This gives me the output I need, but in a column. See the screen shot attached

Power BI Matrix - Only Show Subtotals for Numeric Values

Fairly new to Power BI, trying to replicate SSRS reports but am struggling with what in SSRS would be really simple.
I have a matrix which has subtotal rows for the "groups". Some of the values in the matrix are text values rather than numbers. I want to remove the text "subtotals" from the subtotal row, but can only see how to remove the entire row.
For example, I have a value called Deal Type which can hold Growth, Primary or Secondary so in the subtotal row, I am seeing Growth, where I actually don't want to see anything.
We are evaluating Power BI for our business and it seems one day we find something that we love and then next day, a bunch of minus points.
Thanks for your help
EDIT
As you will see, for the subtotal and total rows, I don't want to see Primary, France, and EUR but I do want the values of the numeric columns.
Unrealized and CompanyName are used as the Rows, for security reasons can't show the Company Names.
Hope that helps
It's hard to give a precise answer without any visibility of your actual data structure... But it sounds like you need to create a measure, something like:
=IF (
HASONEVALUE ( MyTable[Group Item] ),
FIRSTNONBLANK ( MyTable[Deal Type], 1 ),
BLANK ()
)