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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Dynamic legend using a DAX measure

Hi everyone,

 

Details:

 

I am using a Clustered Column Chart to show Total sales by geographic area. The data looks like this:

 

GEOTotal Sales     Sales  CompleteSales Pending 
Americas10,000,000     5,000,0005,000,000
ASIA12,000,000     6,000,0006,000,000
EMEA14,000,000     7,000,0007,000,000

 

Desired outcome: 

 

I want to use the Clustered Column Chart to show Sales Complete & Sales Pending next to each other with the axis showing by Geo. 

 

The Problem:

 

Currently I am connected to a data cube using a live connection so I cannot create a DAX table to create a category filter.

 

Question:

 

How can I create a legend using a DAX measure that will give me the desired outcome given I am using a live connection?

 

Thank you!

 

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@Anonymous Yeah, the usual way of doing this is the disconnected table trick:

In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I cannot enter data, I am on a live connection so this option is not given 

Hi, @Anonymous 

Unfortunately, you cannot apply the created measure to the visual legend , and  Live connection does not support the creation of calculated columns and tables.

We suggest you to modify the original model by adding a category table.

 

Best Regards,
Community Support Team _ Eason

Anonymous
Not applicable

@v-easonf-msft can you elabrate more on adding a category table, what exactly do you mean?

Hi, @Anonymous 

The table used to create the category filter should be created in advance when building the LC model, not after the model is connected using powerbi.

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.