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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
fbrickley
New Member

Advanced pivot? Advanced matrix view?

Hi everyone

 

I currently have data in the following format where each company can have multiple packages, sale currency and billing currency. Crucially the same company could within a particular month have multiple sale currencies, billing currencies and packages.

 

CompanyNamePackageNameSaleCurrencySaleAmountBillingCurrencyBillingAmountBillingDate
Company 1Package 1EUR101GBP12301-03-22
Company 1Package 2USD300GBP40001-02-22
Company 1Package 2ZAR400GBP30001-02-22

 

 I would like to put it into the format, where each combination of CompanyName, SaleCurrency, BillingCurrency has its own row:

   2022   
   Feb Mar 
CompanyNameSaleCurrencyBillingCurrencySaleAmountBillingAmountSaleAmountBillingAmount
Company 1EURGBP  101

123

Company 1USDGBP300400 

 

Company 1ZARGBP400300 

 

 

Where the year and month fields can be drilled down on. Essentially this is like a matrix but with some additional fields to summarise over held on the left hand side. I'd also like to be able to open up each row to see summaries for individual packages.

The data goes back several years and will continue to be added to month-by-month. Is this possible?

 

Currently I have the idea to create a unique ID for each combination of CompanyName, SaleCurrency and BillingCurrency, create a new table with those as the values in the first column - this I have managed. The next step would be to programatically create columns, one for each month, then fill in the required values. I really don't know where to start with this - any help is much appreciated!

 

Thanks

3 REPLIES 3
fbrickley
New Member

Thanks for your reply. Unfortunately your solution doesn't work when a company has multiple sale or billing currencies within the same month. I've made my requirements clearer to show that I would like these to have their own rows so that within each month it's possible to see what's happening for each company in each combination of currencies - is this possible?

Hi @fbrickley,

Perhaps you can consider moving the currency fields to row fields instead of column fields. Then power bi matrix visual will group your records based on company and currency fields.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
PijushRoy
Super User
Super User

Hi

 

Power BI Matrix Table

Change The alignment of the Column Header. If needed, I will share PBIX file, please let me know.

If solve the requirement, Please mark this answer as SOLUTION and give me Kedos.


PBI1.PNG
Power Query Steps
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PLUjMq1QwVNJRCkhMzk5MTwWzXUODgKShAYjt7hQAYhsZA0kDQ10DY10jAyMjpVgd7NqNgOzQYBcgaWxgANduAmaDtBtBtccCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CompanyName = _t, PackageName = _t, SaleCurrency = _t, SaleAmount = _t, BillingCurrency = _t, BillingAmount = _t, BillingDate = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"CompanyName", type text}, {"PackageName", type text}, {"SaleCurrency", type text}, {"SaleAmount", Int64.Type}, {"BillingCurrency", type text}, {"BillingAmount", Int64.Type}, {"BillingDate", type date}}),
#"Inserted Month Name" = Table.AddColumn(#"Changed Type", "Month Name", each Date.MonthName([BillingDate]), type text),
#"Inserted Year" = Table.AddColumn(#"Inserted Month Name", "Year", each Date.Year([BillingDate]), Int64.Type),
#"Reordered Columns" = Table.ReorderColumns(#"Inserted Year",{"CompanyName", "PackageName", "SaleCurrency", "BillingCurrency", "SaleAmount", "BillingAmount", "BillingDate", "Month Name", "Year"})
in
#"Reordered Columns"

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.