Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Put measurements as axes of a graph and axes in legend

Hello

I'm trying to represent a graph I had in Google Sheeds in Power BI, but I can't figure out how to do it.

The graph I want to obtain is:

gerardcanals_1-1634722012900.png

In my power BI model:

CT, CM and Total are values of a category.

Fact. 2019, Fact. 2020, Fact. 2021, Pdos. Entered 2019, etc. are measurements.

In power BI, I get:

gerardcanals_2-1634722124415.png

But I would like CM and CT to be legendary and measurements to appear as an axis. The problem is, when I put CM and CT in legend, it only allows me to put a measurement in the value field.

In google sheets there is the option of "Switch rows / colums" that allows me to make this change in a very simple way:

gerardcanals_3-1634722410270.png

gerardcanals_5-1634722471988.png

Did you have any way to do this in Power BI?

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @Syndicate_Admin 

What's your data structure in Data View? If  you want to put measure into Axis, you can refer to this blog,

https://community.powerbi.com/t5/Community-Blog/The-workaround-of-using-the-measure-as-axis-in-the-v...

Personally speaking, this method is the most recommended.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Syndicate_Admin , You might have to unpivot the tables

 

example like

https://community.powerbi.com/t5/Desktop/Matrix-Display-Values-above-Columns/td-p/256905

 

Or create a custom table

 

union(
summarize('Table',"Measure","sales","This period",[SALES YTD],"Last period",[SALES LYTD],"POP",[SALES YOY])
summarize('Table',"Measure","unit","This period",[unit YTD],"Last period",[unit LYTD],"POP",[unit YOY])
)

 

or

 

union(
summarize('Table',"Measure parent","Measure1","Measure",[Measure1])
summarize('Table',"Measure parent","Measure2","Measure",[Meausre2])
)

 

 

or

 

https://www.daxpatterns.com/dynamic-segmentation/

https://community.powerbi.com/t5/Desktop/grouping-measure-results/td-p/456795

Hello, thanks for the information, but I think I have not explained myself well.

CT and CM are a category of customers, but that is already defined in the tables, they do not depend on the sales value obtained, they are independent. For example, CT can contain clients: 1, 2, and 3. CM: 4, 5 and 6. And this does not change, therefore, I do not need a dynamic segmentation.

Then, I have Fact. 2019, Fact. 2020, Fact. 2021, Ped. 2019, Ped. 2020 and Ped. 2021 which are measurements made with DAX, are not fields of a table, therefore, I can not make joins between tables.

I will show an example of what I want to do, but instead of using a graph I do it in a matrix. Initially we have:

gerardcanals_0-1635148933596.png

But we want to have the measurements in the rows and the customer categories in the columns. For this case power BI has a functionality that allows you to do it (endro of values --> show in rows):

gerardcanals_1-1635149102034.png

I want to do exactly the same thing, but in a graph:

Initially I have (I would need to add the total):

gerardcanals_2-1635149205543.png

I want (orange is the total):

gerardcanals_3-1635149732400.png

The "values" option --> "show in rows" is only available in the matrix display and not in the bar graph, therefore, I cannot do it by this method. I was told that there is the possibility of making a measurement with a switch (I have to test it) but I would be interested to know if there are other options.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.