Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am attempting to do the exact same thing as this post, but getting strange results.
Solved: Shared header for measures in a matrix - Microsoft Power BI Community
I would like to display my measures with a shared header like this...
In the first attempt below, I apply the two columns from "Table" to the columns of a matrix as in the above post. This does not however display the two columns. Only the first one. In the second attempt below, I can accomplish displaying two column headers by moving one of the columns to the values field along with "measure" from "Table". This nearly works, but is displaying the word from column 2 instead of the value from the measure, and the headers are not the values from column two in "table" as I would like.
EDIT: Zirect Labor was Direct Labor. I Noticed that the DAX switch was simplay falling through alphabetically due to the MAX function, so I tried to Zirect to check, and that was happening. I'm not entirely comfortable with this DAX, so I'm not sure if thats what it should do or not, but of course, I want to show each case in the switch statment, so there should be 9 total columns.
Here is my measure...
My second attempt which at least displays a shared header, but incorrect secondary headers, which I want to be the values in column2
This is the data in "Table"
Hi @epelton ,
Please try expand all down one level in the hierarchy.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Thanks Gao. This does display the headers correctly, however, the client does not consider this to be a solution, as they drill up and down while using the report and want both headers displayed regardless.
Measure =
SWITCH(TRUE(),
SELECTEDVALUE(GUI_Headers[Header_lvl1])="Total" && SELECTEDVALUE(GUI_Headers[Header_lvl2]) = "Sum header", [Sum],
SELECTEDVALUE(GUI_Headers[Header_lvl1])="Total" && SELECTEDVALUE(GUI_Headers[Header_lvl2]) = "Avg header", [Avg],
SELECTEDVALUE(GUI_Headers[Header_lvl1])="Last day" && SELECTEDVALUE(GUI_Headers[Header_lvl2]) = "Sum LD header", [Sum LD],
SELECTEDVALUE(GUI_Headers[Header_lvl1])="Last day" && SELECTEDVALUE(GUI_Headers[Header_lvl2]) = "Avg LD header", [Avg LD]
)
Works for me. You can still drill down Region > City. 🙂
Proud to be a Super User!
Can you post here a sample data to work with? eg via wetransfer.com
Also an information (paint/excel) how do you want this to look like would be cool.
Proud to be a Super User!
I've updated the post with how I want the headers to be displayed. The data is just floats in measures.
User | Count |
---|---|
93 | |
83 | |
77 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |