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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
filexsundeep09
Frequent Visitor

Based on Slicer Selections data should be show (Strings)

Hi Experts,
Please help me with the below scenario.
I want to display a different level of data in a table visual, 

Slicer Sel =
var A = FIRSTNONBLANK('Region Table'[Comments],COUNT('Regiont Table'[Comments]))
var B = FIRSTNONBLANK('Unit Table'[Comments],COUNT('Unit Table'[Comments]))
var C = FIRSTNONBLANK('Global table '[Comments],COUNT('Global table '[Comments]))

var D = IF(ISFILTERED('Dim Region'[Unit]),B,IF (ISFILTERED('Dim Region'[Region]),A,IF(ISFILTERED('Dim Region'),C)))
return
D


1.If I  am selecting a region in the slicer 
Expecting Out put:  Region table Test data should be displayed in the table visual 
2.If I  am selecting a Unit in the slicer 
Expecting Out put: Unit table Test data should be displayed in the table visual 
3.If I  am not  selecting anything in the slicer 
Expecting Out put : Global table Test data should be displayed in the table visual 


Example 
I have three tables 
Region table:

RegionLine ItemTest data
Americamachine'ssales good 
Europefashionavarge

Unit table:

unitLine itemtest data
clombiomachine'sTest_1
North americafashionTest_2

Global table:

Line ItemTest data
machine'sMachine are good compared to region sale's
fashionHigh sales


i am getting only region level and unit level test data but not getting global level test data (means not filttering anything in the slicer ) please help me on this.
Regards,
Chanti

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @filexsundeep09 

You can refer to the following example.

1.Create a new table, the information is as follows:

vxinruzhumsft_0-1673941869453.png

 

2.Create a measure:

Measure = var _add1 = ADDCOLUMNS(ALLSELECTED('Global table'),"Rank",RANKX(ALLSELECTED('Global table'),[Line Item],,ASC,Dense))
var _add2=ADDCOLUMNS(ALLSELECTED(Region),"Rank",RANKX(ALLSELECTED(Region),[Region],,ASC,Dense))
var _add3=ADDCOLUMNS(ALLSELECTED(Unit),"Rank",RANKX(ALLSELECTED(Unit),[unit],,ASC,Dense))
return SWITCH(TRUE(),ISFILTERED(Unit[unit])=FALSE()&&ISFILTERED(Region[Region])=FALSE(),MAXX(FILTER(_add1,[Rank]=MAX('Row'[Row])),[Test data]),ISFILTERED(Unit[unit]),MAXX(FILTER(_add3,[Rank]=MAX('Row'[Row])),[test data]),ISFILTERED(Region[Region]),MAXX(FILTER(_add2,[Rank]=MAX('Row'[Row])),[Test data]))

Then put the "Row" column and measure to the table visual.

Output:

vxinruzhumsft_1-1673941979800.png

 

vxinruzhumsft_2-1673942004836.png

Best Regards!

Yolo Zhu

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

1 REPLY 1
Anonymous
Not applicable

Hi @filexsundeep09 

You can refer to the following example.

1.Create a new table, the information is as follows:

vxinruzhumsft_0-1673941869453.png

 

2.Create a measure:

Measure = var _add1 = ADDCOLUMNS(ALLSELECTED('Global table'),"Rank",RANKX(ALLSELECTED('Global table'),[Line Item],,ASC,Dense))
var _add2=ADDCOLUMNS(ALLSELECTED(Region),"Rank",RANKX(ALLSELECTED(Region),[Region],,ASC,Dense))
var _add3=ADDCOLUMNS(ALLSELECTED(Unit),"Rank",RANKX(ALLSELECTED(Unit),[unit],,ASC,Dense))
return SWITCH(TRUE(),ISFILTERED(Unit[unit])=FALSE()&&ISFILTERED(Region[Region])=FALSE(),MAXX(FILTER(_add1,[Rank]=MAX('Row'[Row])),[Test data]),ISFILTERED(Unit[unit]),MAXX(FILTER(_add3,[Rank]=MAX('Row'[Row])),[test data]),ISFILTERED(Region[Region]),MAXX(FILTER(_add2,[Rank]=MAX('Row'[Row])),[Test data]))

Then put the "Row" column and measure to the table visual.

Output:

vxinruzhumsft_1-1673941979800.png

 

vxinruzhumsft_2-1673942004836.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors