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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
bleow
Frequent Visitor

Reference data in charts in text box

I need to generate sentences referencing data in graphs, e.g. the 32% and 30% in the chart as shown below:

bleow_0-1623733768250.png

to come out with sentences like "the highest X is [value] at [percent]".

 

 

Currently I'm using the Smart Narrative function to add these to text boxes as values: 

bleow_2-1623734102524.png

(the real fields have been replaced with xxxx)

 

 

However, I'm having difficulties getting the AI to generate values as percentage of grand total, as well as perform arithmetic operations. Is there a way to generate these numbers as text easily, without the need to rewrite every graph's data and filter contexts as a DAX measure?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@bleow 

 

You can create a measure using a card visual. Please check my example below:

 

Measure =
VAR topitem = CALCULATE(MAX([Item]),FILTER('Table',[Value]=MAXX(ALL('Table'),[Value])))
VAR top_percent = FORMAT(MAXX(ALL('Table'),[Value]) / SUMX(ALL('Table'),[Value]),"percent")
Return CONCATENATE("The Highest Item is ", CONCATENATE(topitem, CONCATENATE(" at ", top_percent)))
 

Vpazhenmsft_0-1623897539313.png

 

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@bleow 

 

You can create a measure using a card visual. Please check my example below:

 

Measure =
VAR topitem = CALCULATE(MAX([Item]),FILTER('Table',[Value]=MAXX(ALL('Table'),[Value])))
VAR top_percent = FORMAT(MAXX(ALL('Table'),[Value]) / SUMX(ALL('Table'),[Value]),"percent")
Return CONCATENATE("The Highest Item is ", CONCATENATE(topitem, CONCATENATE(" at ", top_percent)))
 

Vpazhenmsft_0-1623897539313.png

 

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

amitchandak
Super User
Super User

@bleow , Try a measure like

 

divide(CALCULATE([Measure],TOPN(1,allselected('Table'[category]),[Measure],DESC),VALUES('Table'[category])), [Measure])

 

or

 

divide(CALCULATE([Measure],TOPN(1,allselected('Table'[category]),[Measure],DESC),VALUES('Table'[category])), calculate([Measure],all(Table)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.