- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Use many columns in Power BI as X axis
Hello, I have a table like this
Key A B
1 Fail OK
2 OK NA
I want to have a barchart with A and B in x axis (so 2 bars), and the distribution of Fail, OK and NA as value (Fail, OK, NA as legend), y axis = Number of key
Do you know how to do this ? I want to use only DAX measure, not calculated table
Maybe calculated column if possible
But don't want to make unpivot with Query, i don't want to change my table
Thank you in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can simulate unpivoting with DAX by using SELECTCOLUMNS and UNION. For more details, you can check this explanation (https://community.fabric.microsoft.com/t5/Desktop/Unpivot-columns-using-dax/td-p/1350856).
However, I recommend using Power Query instead. I don't see any reason not to use it, but if you have specific reasons for avoiding it, please let me know.
By the way, I don't think you can achieve this without using a calculated table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I think you need to unpivot your A and B columns, like this:
Key | Type | Value |
1 | A | Fail |
1 | B | OK |
2 | A | OK |
2 | B | NA |
5 | A | Fail |
5 | B | OK |
Then you just need to put those in the bar chart
if key is a number like this:
Please if it solved your issue mark as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah but how with DAX ? i want to avoid Power query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can simulate unpivoting with DAX by using SELECTCOLUMNS and UNION. For more details, you can check this explanation (https://community.fabric.microsoft.com/t5/Desktop/Unpivot-columns-using-dax/td-p/1350856).
However, I recommend using Power Query instead. I don't see any reason not to use it, but if you have specific reasons for avoiding it, please let me know.
By the way, I don't think you can achieve this without using a calculated table.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
06-02-2024 10:26 PM | |||
07-29-2024 04:03 AM | |||
08-12-2024 10:10 PM | |||
07-15-2024 08:19 AM | |||
Anonymous
| 09-19-2023 12:38 AM |
User | Count |
---|---|
132 | |
105 | |
86 | |
55 | |
46 |