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
River
Helper IV
Helper IV

Create a new table from measure plus new column for a cateory

Hi Friends,

 

I need to create a new table for %100 stack bar chart. Column type will be new column, other columns will be from measures in other tables.

 

So, the bar chart will have two bars with same height/length. How can I do it? Any hint is very much appreciate it.

 

table would like this:

TypeInvoiceInterestPaymentDiscountBalance
Charge10000100   
Payment  9800100200
4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @River 

 

You could refer to this blog DAX Measure in the Axis of the Power BI Report - RADACAD. It should be helpful. You just need to add a new table with only "Type" column. Then create a measure with SWITCH function to calculate different measures depending on different Type value. Put this measure into bar chart as Values field. Give it a try!

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

amitchandak
Super User
Super User

@River , In a calculated column, you can not add measures. The measure will not follow any filter and will have statics value

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@amitchandak 

 

Thanks for reply. This is all because of we need to use 100% stack bar chart, basically matching two bars for 'Charge' and 'Payment'.  so we need to build a table I showed. 

All columns like 'invoice', 'interest', 'Payment', 'discount', 'balance' are measures from other tables, then I add a 'Type' column (hard code) in order to make two bars. 

 

Is there any alternative for this?  Sorry I can't give an sample since those measures involved quite a few tables and relations between.

 

Many thanks,

 

@amitchandak 

 

By the way, even it's  static, can you show how to build the table?

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.