Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a sales listing.
Sales are grouped according to document number.
Each document number can have multiple sales lines.
VL Sales: All sales lines are of the VL type.
VR Sales: All sales lines are of the VR type.
Mixed Sales: There are sales lines that are VL and VR.
https://1drv.ms/u/s!AmRMGhswPKfD929RMuToyEAHE6x-?e=5retIu
The column "My Check" I have created manually and it is my goal, that code is completed that data for each and every one of the sales lines.
"Check Soluton 1" is the column created with the first solution by you. Provided.
"Check solution 2" is the measure created with the second solution by you. Provided.
My goal is to get a chart like the one below, in which I can get a summary of sales according to the "type line Sale" made. And that the unclassified 3284.28 come out correctly classified and add up to 3550.99 between VL, VR and VMixta.
Solved! Go to Solution.
Hi @Syndicate_Admin ,
Please update the applied code in Advanced Editor as below: update the data type of column Cant as Whole number. Later check whether you can get the correct result.
| let Origen = Excel.Workbook(File.Contents("C:\Users\jorge\OneDrive\Público\VentasMixtasPBI.xlsx"), null, true), #"Table (2)_Sheet" = Origen{[Item="Table (2)",Kind="Sheet"]}[Data], #"Encabezados promovidos" = Table.PromoteHeaders(#"Table (2)_Sheet", [PromoteAllScalars=true]), #"Tipo cambiado" = Table.TransformColumnTypes(#"Encabezados promovidos",{{"Date", type date}, {"Cod", type number}, {"Descripcion", type text}, {"Cant", Int64.Type}, {"Type Line Sale", type text}, {"ImpBruto", type number}, {"NumOp", type text}, {"CHECK", type text}}), #"Columnas con nombre cambiado" = Table.RenameColumns(#"Tipo cambiado",{{"CHECK", "My CHECK"}}) in #"Columnas con nombre cambiado" |
I just created a sample pbix file based on your provided excel file, it can get the correct result after updated the data type of column Cant as Whole number.
Best Regards
Hi @Syndicate_Admin ,
Please update the applied code in Advanced Editor as below: update the data type of column Cant as Whole number. Later check whether you can get the correct result.
| let Origen = Excel.Workbook(File.Contents("C:\Users\jorge\OneDrive\Público\VentasMixtasPBI.xlsx"), null, true), #"Table (2)_Sheet" = Origen{[Item="Table (2)",Kind="Sheet"]}[Data], #"Encabezados promovidos" = Table.PromoteHeaders(#"Table (2)_Sheet", [PromoteAllScalars=true]), #"Tipo cambiado" = Table.TransformColumnTypes(#"Encabezados promovidos",{{"Date", type date}, {"Cod", type number}, {"Descripcion", type text}, {"Cant", Int64.Type}, {"Type Line Sale", type text}, {"ImpBruto", type number}, {"NumOp", type text}, {"CHECK", type text}}), #"Columnas con nombre cambiado" = Table.RenameColumns(#"Tipo cambiado",{{"CHECK", "My CHECK"}}) in #"Columnas con nombre cambiado" |
I just created a sample pbix file based on your provided excel file, it can get the correct result after updated the data type of column Cant as Whole number.
Best Regards
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 56 | |
| 45 | |
| 35 | |
| 34 | |
| 21 |
| User | Count |
|---|---|
| 143 | |
| 122 | |
| 100 | |
| 80 | |
| 57 |