Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
Kindly help me create shared column header in matrix.
Ex:
thank you.
Hi @Snagalapur
Assuming you have a table similar in structure to this:
You could put your period and metric fields on the columns field well and expand down:
Result would look like this:
Alternatively, you can create a disconnected table very similar to this:
And you can create a measure with a switch statement to return the correct value(s):
MyValue =
// retrieve column metric
VAR _Metric = SELECTEDVALUE(Metric[Metric])
RETURN
// return value for specified metric
CALCULATE(SUM('Table'[Value]), 'Table'[Metric] = _Metric)
thank you so much for details but my data is in same format as mentioned here, not sure how to handle
Hi @Snagalapur ,
You would need to go into PowerQuery do some table transformations to unpivot those columns. You'll likely hearthe phrase: "go long instead of wide" many times throughout your BI journey.
So if your table structure is like this:
You would need to select all the columns that doesn't need pivoting like so:
Then right-click and of those columns and click "unpivot other columns"
And your result should look similar to this:
User | Count |
---|---|
73 | |
72 | |
39 | |
25 | |
23 |
User | Count |
---|---|
96 | |
93 | |
50 | |
43 | |
42 |