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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
EAPCGF
Frequent Visitor

custom smart narrative for percent of total

Hi I have a viz with 2 categories and a count of patients in each category. I also have a matrix table showing same.

I need a smart narrative that tells me the percent in each category.

We don't have access to copilot.

When I right click, "summarise" the viz, the summary tells me the count of the highest category as a percent of total, but not the percent of total of the other (lower) category.

When I creat a new value in smart narrative, I can get the count by typing count of (category) easily, but I can't get a percent of total.

I can't get it to recognize/replicate the 'summary' text  which says 'as a % of total'

In my matrix table I added a column with DAX formula for calculating percent of total for each category. In the matrix table the percent of total is correct, but when I try to get the smar narrative to tell me percent of total for each category, it just shows 100%, not the percent of each of the two categories. 

What language do I use for the smart narrative? or what other DAX to I need?

screen shots. 

Thanks

 

what summary does

EAPCGF_1-1728577122237.jpeg

what i tried

 

EAPCGF_0-1728577096328.jpeg

what i tried also

EAPCGF_2-1728577141599.jpeg

 

DAX for percent measure

EAPCGF_3-1728577152784.jpeg

 

 

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

Hi @EAPCGF ,

 

I've made a test for your refrence:

1\I assume there is a table(Table)

vbofengmsft_0-1728963835313.png

2\Add a caculate column

Percent Stream2 = CALCULATE(COUNTROWS('Table'),Filter('Table',EARLIER('Table'[65 or older])='Table'[65 or older]))/COUNTROWS('Table')

vbofengmsft_1-1728963957938.png

3\Set the visual

vbofengmsft_2-1728963976893.pngvbofengmsft_3-1728963989366.png

 

Best  Regards,

Bof

View solution in original post

10 REPLIES 10
v-bofeng-msft
Community Support
Community Support

Hi @EAPCGF ,

 

I've made a test for your refrence:

1\I assume there is a table(Table)

vbofengmsft_0-1728963835313.png

2\Add a caculate column

Percent Stream2 = CALCULATE(COUNTROWS('Table'),Filter('Table',EARLIER('Table'[65 or older])='Table'[65 or older]))/COUNTROWS('Table')

vbofengmsft_1-1728963957938.png

3\Set the visual

vbofengmsft_2-1728963976893.pngvbofengmsft_3-1728963989366.png

 

Best  Regards,

Bof

Hi Bof, that's great, thank you very much 😃

EAPCGF
Frequent Visitor

ID65 or older
1Under 65
2Under 65
3Under 65
4Under 65
565 or Over
6Under 65
765 or Over
8Under 65
9Under 65
10Under 65

I played around with this a bit but haven't gotten it to work yet.  Will try a few more things, but maybe someone else with more expertise on smart narratives can chime in.

Thank you for trying, can anyone recommend a way to bump this question or post it somewhere else? Even if the answer is that there is no solution it would be good to know. thank you

Irwan
Memorable Member
Memorable Member

hello @EAPCGF 

 

i assumed you want to get the result based on the description in Calculate box in smart narratives.

 

have you tried to write exact same sentence as the auto generated in your custom narratives?

Irwan_1-1728962680785.png

 

Also, i got the same problem in my project and couldnt figure out how or why.

in my case, even if i wrote the exact same description as auto generated, it still will not show same result as auto generated showed.

 

so for me, i created a new measure only for this narratives. here is the example using your sample data.

Irwan_0-1728962487829.png

so in Calculate box, i just put the measure inside.

and yes, it is kinda redundant measure only to be used for one narrative.

 

Hope this will help.

Thank you.

EAPCGF
Frequent Visitor

ID65 or older
1Under 65
2Under 65
3Under 65
4Under 65
565 or Over
6Under 65
765 or Over
8Under 65
9Under 65
10Under 65
lbendlin
Super User
Super User

Can you share sample data that covers the scenario?

Hi

Thank you, I cant see how to attach a file but here is a screen shot of some dummy data

EAPCGF_0-1728607319363.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.