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.
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 |
---|---|
80 | |
78 | |
37 | |
34 | |
31 |
User | Count |
---|---|
93 | |
81 | |
60 | |
49 | |
49 |