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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BharathM
Helper IV
Helper IV

Dispaly zero of Non selected locations ,Sample Data uploaded

Hi everyone,

I need help. I have a matrix visual, and in the columns, I added the locations. I also enabled 'switch values to rows,' and I added all the columns in the visual from the table. I have more than 20 columns, but I've only added a few columns for now.

My requirement is that if any location is selected in the slicer, I need to see the values according to it, and the remaining should display zero. Can anyone help me with this?

Simply  selected location values should display their values, and the remaining should show zero.

However, I have a single table, and from this table, I connected to another table where I have detailed data, and I'm showing drill-through from this table

Expected Output

BharathM_0-1709204179871.png

DisplayZero.pbix

1 ACCEPTED SOLUTION
VillyMBI
Resolver I
Resolver I

Hello @BharathM ,

You can create a new table for Location like "Location = DISTINCT(SELECTCOLUMNS('Truck Table', "Location", [Locations]))" without any relationship with your Truck table.
 
 Use this new Location table in slicer and create measures for each of the colum you want to display
like

M Truck Travelled =
Var _SelectedLocation = SELECTEDVALUE(Location[Location])

 

VAR _TruckTravelled = CALCULATE(SUM('Truck Table'[Trcuk Travelled]), FILTER('Truck Table', [Locations] = _SelectedLocation))

 

RETURN IF(ISBLANK( _TruckTravelled), 0 , _TruckTravelled)

If the post helps please give a thumbs-up and If it solves your issue, please accept it as the solution to help the other members.

View solution in original post

1 REPLY 1
VillyMBI
Resolver I
Resolver I

Hello @BharathM ,

You can create a new table for Location like "Location = DISTINCT(SELECTCOLUMNS('Truck Table', "Location", [Locations]))" without any relationship with your Truck table.
 
 Use this new Location table in slicer and create measures for each of the colum you want to display
like

M Truck Travelled =
Var _SelectedLocation = SELECTEDVALUE(Location[Location])

 

VAR _TruckTravelled = CALCULATE(SUM('Truck Table'[Trcuk Travelled]), FILTER('Truck Table', [Locations] = _SelectedLocation))

 

RETURN IF(ISBLANK( _TruckTravelled), 0 , _TruckTravelled)

If the post helps please give a thumbs-up and If it solves your issue, please accept it as the solution to help the other members.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors