Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Create table with distinct values from column of original table

Hello,

I have an initial table with a column for Accounts, Balance and Date. I need to extract the average per month of the Balances per Account, however I will need to further cross this information with other tables, and therefore I need this information in a new table and not using DAX.

I have already managed to create a column with the average of each Month/Account (“Balance_Avg”) and another one with the respective month (“Date_Month”, I basically transformed all the dates into the first day of the respective month).

I now need a new table where I have only every unique occurrence from “Account” and “Balance_Avg” (otherwise when I use this column as a value it will sum all the ocurrences along with other issues while combining this table).

I had already tried the following approaches:

  • In Query Editor removing duplicates based on the “Account” and “Balance_Avg”, however, given that the “Balance_Avg” column was created using DAX the fact that I make this step in Query Editor the elimination of the duplicates occur before the calculation of the Average, thus defeating the purpose.
  • The following solution, however I have already tried to apply this formula, but it simply replicates every value, I can’t seem to make it work.
    https://community.powerbi.com/t5/Desktop/Create-a-new-table-with-distinct-values/td-p/534662

I have already been stuck in the problem for quite a while, any help would be great.

Thank you in advance for your time.   

 

OriginalOriginalOriginalCalculatedCalculated (w/ DAX)
AccountBalanceDateDate_MonthBalance_Avg
A3001/01/201901/01/201940
A6002/01/201901/01/201940
A3003/01/201901/01/201940
A6001/02/201901/02/201950
A3002/02/201901/02/201950
A6003/02/201901/02/201950
B18001/01/201901/01/201990
B6002/01/201901/01/201990
B3003/01/201901/01/201990
B3001/02/201901/02/201930
B3002/02/201901/02/201930
B3003/02/201901/02/201930

 

Objective  
AccountDate_MonthBalance
A01/01/201940
A01/02/201950
B01/01/201990
B01/02/201930
1 ACCEPTED SOLUTION
rocky09
Solution Sage
Solution Sage

something like this?

 

New Table = SUMMARIZE(OriginalTable,OriginalTable[Account],OriginalTable[Date_Month],OriginalTable[Balance_Avg])

View solution in original post

2 REPLIES 2
rocky09
Solution Sage
Solution Sage

something like this?

 

New Table = SUMMARIZE(OriginalTable,OriginalTable[Account],OriginalTable[Date_Month],OriginalTable[Balance_Avg])
Anonymous
Not applicable

Thank you so much, I was certain that the solution would involve DISTINCT and some sort of LOOKUPVALUE and didn't even assumed to use the simple form of SUMMARIZE.

 

Once again thank you very much, it worked perfectly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.