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
pmargari
Helper II
Helper II

Generate rows at lower level

Hello all,
Any tips to generetate rows at lower level from a table with data on quarters , just to set the same value of each month related to his quarter  ? (example below) 
I have budgets for salesrep , at quater level, that I want to generate de same amount but at month level , any tips to make this append ? 

example.jpg

Appreciate any tips
All the best
KR

3 ACCEPTED SOLUTIONS

Thansk for your reply Nathaniel_C ! , will try this option !! 

View solution in original post

Hello again 
I think the way I picture my need have created a missunderstood , sorry for that , what I need is  to create rows not columns as this example :

example.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thanks

View solution in original post

Hello @pmargari ,
Like this?

Nathaniel_C_1-1673889917513.png

 

Color = IF(MAX(Sales[Month]) In{"Jan","Feb","Mar"},"yellow", "green") //Add this measure to use in your conditional formatting.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcsxJSi0qUdJRMjIAEsYgwhTKitWJVnLOSCzKSS2GSRmbAgkTEGFqCpZ3zEkrSk0BCYKkzUCEiQmEFRsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Sales Rep" = _t, Q1 = _t, Q2 = _t, Q3 = _t, Q4 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Sales Rep", type text}, {"Q1", Int64.Type}, {"Q2", Int64.Type}, {"Q3", Int64.Type}, {"Q4", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Jan", each [Q1]),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Feb", each [Q1]),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Mar", each [Q1]),
    #"Added Custom3" = Table.AddColumn(#"Added Custom2", "Apr", each [Q2]),
    #"Added Custom4" = Table.AddColumn(#"Added Custom3", "May", each [Q2]),
    #"Added Custom5" = Table.AddColumn(#"Added Custom4", "June", each [Q2]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom5",{{"Jan", Int64.Type}, {"Feb", Int64.Type}, {"Mar", Int64.Type}, {"Apr", Int64.Type}, {"May", Int64.Type}, {"June", Int64.Type}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Q1", "Q2", "Q3", "Q4"}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {"Sales Rep"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Month"}, {"Value", "Amount"}}),
    #"Added Conditional Column" = Table.AddColumn(#"Renamed Columns", "Sort1", each if Text.Contains([Sales Rep], "t") then 1 else if Text.Contains([Sales Rep], "s") then 2 else if Text.Contains([Sales Rep], "d") then 3 else null),
    #"Added Conditional Column1" = Table.AddColumn(#"Added Conditional Column", "Sort2", each if [Month] = "Jan" then 1 else if [Month] = "Feb" then 2 else if [Month] = "Mar" then 3 else if [Month] = "Apr" then 4 else if [Month] = "May" then 5 else if [Month] = "June" then 6 else null),
    #"Changed Type2" = Table.TransformColumnTypes(#"Added Conditional Column1",{{"Sort1", type text}, {"Sort2", type text}})
in
    #"Changed Type2"

 

Above is the m language to build your table in Power Query.  Then apply that table to Power BI, and add the measure above to conditional formatting. 


Nathaniel_C_2-1673890455517.png

 



Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Nathaniel_C
Super User
Super User

Hi @pmargari ,
You will not be able to make this append because the column headings are different.  However you could add extra columns for each month based on the quarter values in Power Query. Go to the add column tab, Custom and name the columns by month, and insert the appropriate quarter.  

Apply this table to Power BI and select the quarter, the month columns as in the picture.

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel

Nathaniel_C_0-1673728714830.png

 

Nathaniel_C_1-1673728907192.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello again 
I think the way I picture my need have created a missunderstood , sorry for that , what I need is  to create rows not columns as this example :

example.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thanks

Hello @pmargari ,
Like this?

Nathaniel_C_1-1673889917513.png

 

Color = IF(MAX(Sales[Month]) In{"Jan","Feb","Mar"},"yellow", "green") //Add this measure to use in your conditional formatting.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcsxJSi0qUdJRMjIAEsYgwhTKitWJVnLOSCzKSS2GSRmbAgkTEGFqCpZ3zEkrSk0BCYKkzUCEiQmEFRsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Sales Rep" = _t, Q1 = _t, Q2 = _t, Q3 = _t, Q4 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Sales Rep", type text}, {"Q1", Int64.Type}, {"Q2", Int64.Type}, {"Q3", Int64.Type}, {"Q4", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Jan", each [Q1]),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Feb", each [Q1]),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Mar", each [Q1]),
    #"Added Custom3" = Table.AddColumn(#"Added Custom2", "Apr", each [Q2]),
    #"Added Custom4" = Table.AddColumn(#"Added Custom3", "May", each [Q2]),
    #"Added Custom5" = Table.AddColumn(#"Added Custom4", "June", each [Q2]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom5",{{"Jan", Int64.Type}, {"Feb", Int64.Type}, {"Mar", Int64.Type}, {"Apr", Int64.Type}, {"May", Int64.Type}, {"June", Int64.Type}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Q1", "Q2", "Q3", "Q4"}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {"Sales Rep"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Month"}, {"Value", "Amount"}}),
    #"Added Conditional Column" = Table.AddColumn(#"Renamed Columns", "Sort1", each if Text.Contains([Sales Rep], "t") then 1 else if Text.Contains([Sales Rep], "s") then 2 else if Text.Contains([Sales Rep], "d") then 3 else null),
    #"Added Conditional Column1" = Table.AddColumn(#"Added Conditional Column", "Sort2", each if [Month] = "Jan" then 1 else if [Month] = "Feb" then 2 else if [Month] = "Mar" then 3 else if [Month] = "Apr" then 4 else if [Month] = "May" then 5 else if [Month] = "June" then 6 else null),
    #"Changed Type2" = Table.TransformColumnTypes(#"Added Conditional Column1",{{"Sort1", type text}, {"Sort2", type text}})
in
    #"Changed Type2"

 

Above is the m language to build your table in Power Query.  Then apply that table to Power BI, and add the measure above to conditional formatting. 


Nathaniel_C_2-1673890455517.png

 



Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thansk for your reply Nathaniel_C ! , will try this option !! 

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.