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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JMccoy92
Frequent Visitor

Array of Values to be used in visuals

Hello Everyone, 

 

I am working on a project to take data from a Power App in dataverse and use it in a Power Bi Report. The data is very basic and includes one table with a row for each employee in the company. There is then various flags and attributes to further describe the employee and where they work. The main goal of this report is to keep track of what employees are working from home, in the office or a hybrid of the two. In the app if an employee is a hybrid employee they have to select which days of the week they work remote. This provides me with an array column value  "Tuesday", "Wednesday", "Friday"  as an example, this could be a wide range of different combinations. The days not included in this list are meant to be days they will be in the office.  One of the requirments for the report is to show  Count of Employees in-office by day of week – Vertical Bar and Count of Employees Remote by day of week – Vertical Bar. I am really struggling to figure out a way to make this work. One option I have thought about doing is turning that column into a list, this creates a separate table with EmployeeNumber and Day of the week, duplicating the employee number based on number of days working remote. I think this would work for the "Count of Employees Remote by day of week – Vertical Bar. " request, I just don't know how I would do the other request or if there would be a better way. 

 

Any feedback will be greatly appreciated.

 

Thanks everyone! 

1 ACCEPTED SOLUTION

 There are obviously many ways to solve this but I think you're already on the right track.

 

From your data, I created the below (attached PBIX also)

This provides the count of remote days, obviously from there you can calculate in office days based on your requirement. I wasn't sure if it was only a five day week so I didn't assume.

 

Hope this helps. Let me know if you have any questions.

 

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText(
          "nVVBboMwEPwK4oyE7YVgjr1UvTSR2kg9kByaxqhIASIKlfL7btIUbLK4xBICgzSzO+PxkmX+sm69125XFm2r9n7gr/K8+FBe3h0OXluUCj/hVeErPiTgDcDfBpn/cDw29fcF83TaNcV58YiP9xMu0hBYKJjguOYijeywN7Wv1Bcig82VYnMuKkPONRI5kNzVNAcWO9UfiZilHRnW3YWLomB2iue6GlGYDXEWJj0bsH8aupIgRa+PIJRDe9LZYZEmM5WZxReaGjGTYVLMyGvuLmbhDk0ddti2PbHmUOTeFm0ujTJ9lLSiF1XWrdKPvBlOoWVJb7TH3SJSV3kAjC52O5ewJB/EAXC7uN8hJDQAbaQFQB/SHjAjEOvPrqHSMSpEz1jaOePcA8Tuzifu0ImE2M/KlBlGaAHcsxTRM1rf4SSE4b8EkfOggegvTdsf",
          BinaryEncoding.Base64
        ),
        Compression.Deflate
      )
    ),
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [
        #"Work status" = _t,
        #"Work option" = _t,
        #"Hybrid working remote days" = _t,
        #"Status Date" = _t,
        Employee_SK = _t,
        Organization_SK = _t
      ]
  ),
  #"Changed Type" = Table.TransformColumnTypes(
    Source,
    {
      {"Work status", type text},
      {"Work option", type text},
      {"Hybrid working remote days", type text},
      {"Status Date", type text},
      {"Employee_SK", Int64.Type},
      {"Organization_SK", Int64.Type}
    }
  ),
  #"Replaced Value" = Table.ReplaceValue(
    #"Changed Type",
    "",
    null,
    Replacer.ReplaceValue,
    {"Hybrid working remote days"}
  ),
  #"Added Custom" = Table.AddColumn(
    #"Replaced Value",
    "Custom",
    each try Text.Split([Hybrid working remote days], ",") otherwise null
  ),
  #"Added Custom1" = Table.AddColumn(
    #"Added Custom",
    "RemoteDayCount",
    each try List.Count([Custom]) otherwise 0
  )
in
  #"Added Custom1"

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

View solution in original post

3 REPLIES 3
KNP
Super User
Super User

I think it should be a relatively straight forward issue to solve but can you please post some sample data in table format and maybe the Power Query code you have so far?

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!
JMccoy92
Frequent Visitor

Work statusWork optionHybrid working remote daysStatus DateEmployee_SKOrganization_SK
Not SubmittedOffice full time null8333
ApprovedHybrid"Friday"9/30/2021129433
ApprovedHybrid"Wednesday","Friday"8/11/2021129833
Not SubmittedOffice full time null130533
ApprovedHybrid"Wednesday","Friday"9/30/2021129333
ApprovedHybrid"Friday","Tuesday"9/30/2021129033
ApprovedHybrid"Monday","Tuesday","Friday"10/7/2021130333
ApprovedHybrid"Tuesday","Wednesday","Friday"10/8/2021128833
Not SubmittedOffice full time null129733
ApprovedHybrid"Monday","Friday"10/6/2021130233
ApprovedHybrid"Monday","Wednesday","Friday"9/30/2021129133
Not SubmittedOffice full time null129633
Not SubmittedOffice full time null129933
ApprovedHybrid"Monday","Tuesday","Wednesday","Friday"10/5/2021130433
Not SubmittedOffice full time null129233
ApprovedOffice full time 9/30/2021128933
ApprovedRemote"Friday"10/7/2021132833
SubmittedRemote 10/7/2021132933
Not SubmittedOffice full time null133033
SubmittedHybrid"Friday"10/10/2021133133
ApprovedRemote 8/12/2021133233
ApprovedRemote 8/12/2021133333
ApprovedRemote"Monday","Tuesday","Wednesday","Thursday","Friday"8/12/2021133433
ApprovedOffice full time 10/8/2021133533
Not SubmittedOffice full time null133733
Not SubmittedOffice full time null133833
SubmittedHybrid"Monday","Tuesday","Thursday","Friday"9/30/2021133933
Not SubmittedOffice full time null134033
ApprovedRemote 7/31/2021134133
Not SubmittedOffice full time null134233

 There are obviously many ways to solve this but I think you're already on the right track.

 

From your data, I created the below (attached PBIX also)

This provides the count of remote days, obviously from there you can calculate in office days based on your requirement. I wasn't sure if it was only a five day week so I didn't assume.

 

Hope this helps. Let me know if you have any questions.

 

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText(
          "nVVBboMwEPwK4oyE7YVgjr1UvTSR2kg9kByaxqhIASIKlfL7btIUbLK4xBICgzSzO+PxkmX+sm69125XFm2r9n7gr/K8+FBe3h0OXluUCj/hVeErPiTgDcDfBpn/cDw29fcF83TaNcV58YiP9xMu0hBYKJjguOYijeywN7Wv1Bcig82VYnMuKkPONRI5kNzVNAcWO9UfiZilHRnW3YWLomB2iue6GlGYDXEWJj0bsH8aupIgRa+PIJRDe9LZYZEmM5WZxReaGjGTYVLMyGvuLmbhDk0ddti2PbHmUOTeFm0ujTJ9lLSiF1XWrdKPvBlOoWVJb7TH3SJSV3kAjC52O5ewJB/EAXC7uN8hJDQAbaQFQB/SHjAjEOvPrqHSMSpEz1jaOePcA8Tuzifu0ImE2M/KlBlGaAHcsxTRM1rf4SSE4b8EkfOggegvTdsf",
          BinaryEncoding.Base64
        ),
        Compression.Deflate
      )
    ),
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [
        #"Work status" = _t,
        #"Work option" = _t,
        #"Hybrid working remote days" = _t,
        #"Status Date" = _t,
        Employee_SK = _t,
        Organization_SK = _t
      ]
  ),
  #"Changed Type" = Table.TransformColumnTypes(
    Source,
    {
      {"Work status", type text},
      {"Work option", type text},
      {"Hybrid working remote days", type text},
      {"Status Date", type text},
      {"Employee_SK", Int64.Type},
      {"Organization_SK", Int64.Type}
    }
  ),
  #"Replaced Value" = Table.ReplaceValue(
    #"Changed Type",
    "",
    null,
    Replacer.ReplaceValue,
    {"Hybrid working remote days"}
  ),
  #"Added Custom" = Table.AddColumn(
    #"Replaced Value",
    "Custom",
    each try Text.Split([Hybrid working remote days], ",") otherwise null
  ),
  #"Added Custom1" = Table.AddColumn(
    #"Added Custom",
    "RemoteDayCount",
    each try List.Count([Custom]) otherwise 0
  )
in
  #"Added Custom1"

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors