The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I have the following steps ending with a table, which I want to display as is in a table report. The M code is :
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ndQ9bsMwDAXg3acQvDYWSOrP1lWCDBocJEVbF4085PaVOrSMHaVyJi3+8J4Jiftm32K7a+M5ntPxOp0+0kFA1IHpSAlED8ZrkMoM4gUIIH/9NY/tYXdrL+GdUxDoPAxeG9kr+qXH8HZZ288QFxa9SVZLcmZtm6Qp6znOi2T7o61XyqOWtlf3kpnlybZDJzD9be9pkI7wfrLKOsSwTkaB9Di5bAut/0bN6BOlddZTnBbBQ03pgu0rSjPKS7v/Sxdjq+Zcts9Wrpyzyfoar9uvZdY26zGOy6foKp6iLdgUXbBsXiVcswOY3bwDmN20A5rDNw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Id = _t, Ref = _t, User = _t, Creationdate = _t, Isuserpartofteama = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Id", Int64.Type}, {"Ref", type text}, {"User", type text}, {"Creationdate", type datetimezone}, {"Isuserpartofteama", type logical}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", (k) => Table.SelectRows(#"Changed Type", each [Id] = k[Id])),
#"Removed Duplicates" = Table.Distinct(#"Added Custom", {"Id"}),
#"Removed Columns" = Table.RemoveColumns(#"Removed Duplicates",{"Ref", "User", "Creationdate", "Isuserpartofteama"}),
Custom1 = Table.SelectRows(#"Removed Columns", each Table.Contains([Custom], [Isuserpartofteama = true])),
#"Added JobStarted" = Table.AddColumn(Custom1, "JobStarted", each Table.Last(Table.SelectRows([Custom], each [Isuserpartofteama] = true))[Creationdate], type datetimezone),
#"Added JobEnded" = Table.AddColumn(#"Added JobStarted", "JobEnded", each if Table.First([Custom])[Isuserpartofteama] = true then "not finished yet" else Table.First(Table.SelectRows([Custom], each [Isuserpartofteama] = false))[Creationdate], type datetimezone),
#"Added TimeTaken" = Table.AddColumn(#"Added JobEnded", "TimeTakenInHours", each Number.Round(if Table.First([Custom])[Isuserpartofteama] = true then Duration.TotalHours(DateTimeZone.LocalNow() - [JobStarted]) else Duration.TotalHours([JobEnded] - [JobStarted]), 2), type duration),
#"Added SLA" = Table.AddColumn(#"Added TimeTaken", "SLA", each if [TimeTakenInHours] > 24 then "NOT OK" else "OK")
in
#"Added SLA"
But when I look into what is shown in power bi desktop, I see that it auto-generated sums and counts for instances, why is that ?
If I add a Table report, I then don't end up with the same amount of columns (date is not 1 column anymore, duration column doesn't show anything) :
What I want to see in my report is exactly the same as that :
How can I achieve this please ?
Thank you,
Hi @jmclej
It's all played in the Format section of the visual
Use
and for the dates format them to Date/Time
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
Hello,
I have already seen indeed that I can select "Don't summarize" on the Visualization panel, but why does it summarize without asking me anything by default ? Why sometimes "Sum of" and sometimes "Count of" ? On what is it based ? Even after I change to "Don't summarize", the SIGMA symbol is still there in the Field panel, how can I change that ? I have changed from datetimezone to datetime also and I still have the date field split in year/month/day/... and my duration field doesn't show a value within a report, why is that ?