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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PowerBI_Rookie
New Member

Changing Title of Table with Slicer.

Hello Power BI Friends,

here is an absolute Beginner, who needs some help.

I would be very thankful if someone could help me.

I need a function to use it as the title of a table.

 

I have a Table and a Slicer.

The Slicer is about the item-number and the table includes the components of the item.

 

I need a function so that as soon as I select an item-number in the slicer and the number of rows in the table changes, that the title of the table count and says "The item has __ components."

 

I already have a function, but it only shows me the total number of the table.

It does not react to the slicer. For Example:

 

"The item has "

            &

        COUNT(

            'items'[item_id]

                         )

            &

            " components."

 

Is this even correct? I think I need to do it with SELECTEDVALUE() but I do not know myself so well with it yet.
And how can I still make use of a function that as soon as nothing is selected in the slicer, the title of the table says something like: "Please select an item-number first."

 

I've seen some videos on YouTube about this with IF() but I don't really understand it yet to be honest.

Maybe an experienced person can help me on the hint.

 

Thank you very much and have a nice weekend 🙂

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

Hi @PowerBI_Rookie ,

Please update the formula of measure as below, please find the details in the attachment.

Dynamic title = 
IF (
    ISFILTERED ( items[item_jd] ),
    "The item has " & COUNT ( 'items'[item_jd] ) & " components.",
    "Please select an item first."
)

yingyinr_0-1673849648463.png

If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

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

8 REPLIES 8
v-yiruan-msft
Community Support
Community Support

Hi @PowerBI_Rookie ,

Please update the formula of measure as below, please find the details in the attachment.

Dynamic title = 
IF (
    ISFILTERED ( items[item_jd] ),
    "The item has " & COUNT ( 'items'[item_jd] ) & " components.",
    "Please select an item first."
)

yingyinr_0-1673849648463.png

If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

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.
sudhav
Helper V
Helper V

create the measure 

Measure_community = "Population By " & IF(HASONEFILTER(Dim_reg[Reg_name]),SELECTEDVALUE(Dim_reg[Reg_name],"Population")) and add it to the visual tittle as fx like below snap and let me know if its useful or not.
sudhav_0-1673619687634.png

 

sudhav
Helper V
Helper V

sudhav_0-1673619504937.pngsudhav_1-1673619547205.png

 

Thank you for your Replay sudhav!

Maybe I have expressed myself incorrectly.

 

I take the Oceania example (left).

I want the number of rows to be in the title.

In this case there are 13 rows to Oceania.

So the title should say something like: "There are 13 countries in Oceania".

Same in the Europe example (right): There are __ countries in Europe.

 

And if nothing is selected in the slicer (Reg_name), it should say: "Please select a region first".

 

But still i thank you for your help! 🙂

sudhav_2-1673621008793.png

if it helps, accept it as solution

Thank you sudhav!

 

I have almost made it.

Could you please formulate the formula like this without the SELECTEDVALUE()?

So it all works, but in my case I don't want the value from the slicer to be in the title.

 

So exactly the same formula but the part with

& SELECTEDVALUE(Dim_reg[Reg_name]))    - should not be used.

 

But as soon as I delete it, the alternative with "Please select a region first" doesn't work anymore. Do you have an alternative formula that is exactly the same (because it works for me) but without the SELECTEDVALUE() part?

sudhav_0-1673774201359.png

in the measure you can use

Measure_community = IF(HASONEFILTER(tablename[item-number]),( DISTINCTCOUNT(Fact_pop[country_id])& " Rows in "& SELECTEDVALUE(tablename[components of the item])),"Please select a region first")
No need to remove selected value, you can select item number in slicer so that it will give components in the table, please let me know if it works....

Measure_community = IF(HASONEFILTER(Dim_reg[Reg_name]),( DISTINCTCOUNT(Fact_pop[country_id])& " Rows in "& SELECTEDVALUE(Dim_reg[Reg_name])),"Please select a region first")
sudhav_0-1673620937499.pngsudhav_1-1673620960280.png

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.