cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
ALEKSGOD
Helper I
Helper I

report

Hi!
Please have a look at the report I have created.
There are cards -  name of the customer and some numbers (quantity, sales etc.) and treemap. User can choose any customer (from the treemap) to see values for this customer. When nothing is selected user see totals.
The issue is: when nothing is selected I see totals but  in the card 'customer name' is always some (first or last) name of customer.
Logically, it should show 'all customers', 'total' or at least blank. Any idea what could I do?

ALEKSGOD_0-1673898473125.png

Thanks, Aleks

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Try create a measure to use in that text box instead of using an aggregation - something like: 

Customer Name Text Box = IF(ISFILTERED([customer_name]), SELECTEDVALUE([customer_name]), "All Customers")

View solution in original post

2 REPLIES 2
v-binbinyu-msft
Community Support
Community Support

Hi @ALEKSGOD ,

Please try below dax formula:

1. below is my test table

Table:

vbinbinyumsft_0-1673936058144.png

2. create measure with below dax formula

Choose Name =
VAR cur_name =
    SELECTEDVALUE ( 'Table'[Name] )
RETURN
    IF ( ISFILTERED ( 'Table'[Name] ), cur_name, "Not choose name" )
Sales =
VAR _total =
    SUMX ( 'Table', [Sale] )
VAR cur_name =
    SELECTEDVALUE ( 'Table'[Name] )
VAR _val =
    CALCULATE ( SUM ( 'Table'[Sale] ), 'Table'[Name] = cur_name )
RETURN
    IF ( ISFILTERED ( 'Table'[Name] ), _val, _total )

3. add a treemap visual with fields, add card visual with measure

vbinbinyumsft_2-1673936215300.png

 

vbinbinyumsft_1-1673936200056.png

Please refer the attached .pbix file.

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

vicky_
Super User
Super User

Try create a measure to use in that text box instead of using an aggregation - something like: 

Customer Name Text Box = IF(ISFILTERED([customer_name]), SELECTEDVALUE([customer_name]), "All Customers")

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors