using System.Collections.Generic;
public static void Main()
List<Data> dataList = new List<Data>
new Data("A", "T1", "MAU", 100),
new Data("A", "T1", "WAU", 70),
new Data("B", "T2", "MAU", 50),
new Data("B", "T2", "Retention", 30),
.GroupBy(x => new { x.Org, x.Tenant },
CustomData = g.ToDictionary(y => y.Dimension, y => y.Count)
Console.WriteLine(JsonConvert.SerializeObject(result, new JsonSerializerSettings {
Formatting = Formatting.Indented
public record Data(string Org, string Tenant, string Dimension, int Count);