This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello All,
Please help me to transform table #1 to table #2. I need to count Open and Closed task in each month separetely by "Originated Date" column, but in the meantime show how many tasks are closed in each month by "Closed Date" column. How I will be able to do so?
Table #1
Table #2
Solved! Go to Solution.
Hi @Anonymous
if [Originated Date] = "January" then "01/01/2024" else
if [Originated Date] = "February" then "01/02/2024" else
if [Originated Date] = "March" then "01/03/2024" else
if [Originated Date] = "April" then "01/04/2024" else
if [Originated Date] = "May" then "01/05/2024" else
if [Originated Date] = "June" then "01/06/2024" else null
Tasks = SUM(Tasks[Count])Open Tasks =
CALCULATE([Tasks], KEEPFILTERS(Tasks[Status] = "Open"))Closed Tasks =
CALCULATE([Tasks],
KEEPFILTERS( Tasks[Status] = "Closed"),
USERELATIONSHIP(Date[Date], Tasks[Closed Date]))
TasksAll = SWITCH (
SELECTEDVALUE ('Table'[Column1]),
"Raised", [Tasks],
"Closed", [Closed Tasks],
"Open", [Open Tasks])
Add the column from the Status table to the Row section of a Matrix visual. The Month from the Date table goes into the columsn and the measure above into the Values.
Copy and paste the visual and add the Priority Filter in the filetr pane of teh visual and filter to show the Priority you need to show
I hope this helps
Joe
If you found my answer helpful and it solved your issue, please accept as solution
Proud to be a Super User! | |
Date tables help! Learn more
Hi @Anonymous,
Result
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjBW0lHySswrTSyqBLL8C1LzgBQQmRoqxeoA5Y1Q5J1z8otTU4AMt9SkIqgYfoW+iUXJGQhVhkSpMsLhKGOItDF+Q/CrQnK5MTY3IWwzQpiDpAkhb2iC0I9VgRnCN1jljbHqx/APdnfgC2GYEIZTjLFKmiPciSkJdGQsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Priority = _t, #"Originated Date" = _t, Status = _t, #"Closed Date" = _t, Count = _t]),
ReplacedValue = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue, Table.ColumnNames(Source)),
ChangedType = Table.TransformColumnTypes(ReplacedValue,{{"Count", Int64.Type}}),
GroupedRowsTotal = Table.Group(ChangedType, {"Originated Date", "Status"}, {{"Count", each List.Sum([Count]), type nullable number}}),
Ad_Priority = Table.AddColumn(GroupedRowsTotal, "Priority", each "Total", type text),
GroupedRowsMonths = Table.Group(ChangedType, {"Originated Date", "Priority"}, {{"All", each Table.Group(_, {"Status"}, {{"Count", each List.Sum([Count]), type nullable number}}) , type table}}),
ExpandedAll = Table.ExpandTableColumn(GroupedRowsMonths, "All", {"Status", "Count"}, {"Status", "Count"}),
SortedRows = Table.Sort(ExpandedAll,{{"Originated Date", Order.Ascending}}),
CombinedTotalAndMonths = Table.Combine({Ad_Priority, SortedRows}),
PivotedColumn = Table.Pivot(CombinedTotalAndMonths, List.Distinct(CombinedTotalAndMonths[#"Originated Date"]), "Originated Date", "Count"),
SortedRows2 = Table.Sort(PivotedColumn,{{"Priority", Order.Ascending}})
in
SortedRows2
Hi @Anonymous,
Result
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjBW0lHySswrTSyqBLL8C1LzgBQQmRoqxeoA5Y1Q5J1z8otTU4AMt9SkIqgYfoW+iUXJGQhVhkSpMsLhKGOItDF+Q/CrQnK5MTY3IWwzQpiDpAkhb2iC0I9VgRnCN1jljbHqx/APdnfgC2GYEIZTjLFKmiPciSkJdGQsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Priority = _t, #"Originated Date" = _t, Status = _t, #"Closed Date" = _t, Count = _t]),
ReplacedValue = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue, Table.ColumnNames(Source)),
ChangedType = Table.TransformColumnTypes(ReplacedValue,{{"Count", Int64.Type}}),
GroupedRowsTotal = Table.Group(ChangedType, {"Originated Date", "Status"}, {{"Count", each List.Sum([Count]), type nullable number}}),
Ad_Priority = Table.AddColumn(GroupedRowsTotal, "Priority", each "Total", type text),
GroupedRowsMonths = Table.Group(ChangedType, {"Originated Date", "Priority"}, {{"All", each Table.Group(_, {"Status"}, {{"Count", each List.Sum([Count]), type nullable number}}) , type table}}),
ExpandedAll = Table.ExpandTableColumn(GroupedRowsMonths, "All", {"Status", "Count"}, {"Status", "Count"}),
SortedRows = Table.Sort(ExpandedAll,{{"Originated Date", Order.Ascending}}),
CombinedTotalAndMonths = Table.Combine({Ad_Priority, SortedRows}),
PivotedColumn = Table.Pivot(CombinedTotalAndMonths, List.Distinct(CombinedTotalAndMonths[#"Originated Date"]), "Originated Date", "Count"),
SortedRows2 = Table.Sort(PivotedColumn,{{"Priority", Order.Ascending}})
in
SortedRows2
Hi @Anonymous
if [Originated Date] = "January" then "01/01/2024" else
if [Originated Date] = "February" then "01/02/2024" else
if [Originated Date] = "March" then "01/03/2024" else
if [Originated Date] = "April" then "01/04/2024" else
if [Originated Date] = "May" then "01/05/2024" else
if [Originated Date] = "June" then "01/06/2024" else null
Tasks = SUM(Tasks[Count])Open Tasks =
CALCULATE([Tasks], KEEPFILTERS(Tasks[Status] = "Open"))Closed Tasks =
CALCULATE([Tasks],
KEEPFILTERS( Tasks[Status] = "Closed"),
USERELATIONSHIP(Date[Date], Tasks[Closed Date]))
TasksAll = SWITCH (
SELECTEDVALUE ('Table'[Column1]),
"Raised", [Tasks],
"Closed", [Closed Tasks],
"Open", [Open Tasks])
Add the column from the Status table to the Row section of a Matrix visual. The Month from the Date table goes into the columsn and the measure above into the Values.
Copy and paste the visual and add the Priority Filter in the filetr pane of teh visual and filter to show the Priority you need to show
I hope this helps
Joe
If you found my answer helpful and it solved your issue, please accept as solution
Proud to be a Super User! | |
Date tables help! Learn more
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.