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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
selected_
Helper IV
Helper IV

Can't put measure on any other place other than tooltip in bar chart

I have the below measure that gives certian numbers.

 

 

Nr = 
VAR MaxDate = MAX('doc'[EndDate])
RETURN
IF(NOT ISBLANK(MaxDate),
CALCULATE(
LASTNONBLANK('doc'[rating], 1),
FILTER('doc', 'doc'[EndDate] = MaxDate)
        )
    )

 

 

 

 

I am not able to put it in the axis or legend. Not sure why, it only put the measure on tooltip when using barchart visual but works fine on table visual. Any help how I can fix it?

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @selected_ ,

The measure cannot be used directly as an axis or legend in a chart in Power BI. This is because a chart must present the logical relationship between the data, and the data must be grouped according to certain standards (dimensions), and then various aggregation operations are performed. This is the fundamental reason why the measurement value cannot be used as the axis of the chart. 

 

If you want to put it in Axis or Legend option, you can create a calculated column to replace the original measure. One thing to note is that the value of the calculated column cannot be changed by the slicer or by user interaction.

Calculated Columns and Measures in DAX

Calculated Columns vs Measures

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @selected_ ,

The measure cannot be used directly as an axis or legend in a chart in Power BI. This is because a chart must present the logical relationship between the data, and the data must be grouped according to certain standards (dimensions), and then various aggregation operations are performed. This is the fundamental reason why the measurement value cannot be used as the axis of the chart. 

 

If you want to put it in Axis or Legend option, you can create a calculated column to replace the original measure. One thing to note is that the value of the calculated column cannot be changed by the slicer or by user interaction.

Calculated Columns and Measures in DAX

Calculated Columns vs Measures

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

@selected_ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

?

hi

 

I don't understand how it apply to my issue with my measure when I don't mention the records in the measure like Attended and NotAttended. 

 

can you show me how to solve it via my measure? thanks!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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