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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PeterChen
Helper I
Helper I

How to fetch number from visual matrix

I have a data like this:

## TABLE1

GroupTypeNum_Col_1 Num_Col_2
AX1050
BX201000
CX30900

 

I create a TABLE2:

TABLE2 = DISTINCT(TABLE1[Group])

 

I created 3 measures in TABLE2:

Measure1 = CALCULATE( DIVIDE(SUM(TABLE1[Num_Col_2]) , SUM(TABLE1[Num_Col_1])) , TABLE1[Type] = "X")

Measure2 = RANKX( ALL(TABLE1[Group]), TABLE2[Measure1 ],,ASC)

Measure3 = DIVIDE([Rank_EV_LC] - 1, COUNTROWS(TABLE2) - 1)

 

Visual Matrix:

Rows: TABLE1[Group]

Values: TABLE2[Measure1], TABLE2[Measure2], TABLE2[Measure3]

GroupMeasure1Measure2Measure3
A53100%
B50250%
C3010%

 

 

For now, everything is perfect.

However, what I want is to create a filter/slicer and I can fetch the corresponding Measure3 value.
For examle, if I do a filter with SELECTEDVALUE(TABLE1[Group]), and let's say selecting B, I want a visual card or whatever similar to show correct value "50%".

My currect slicer will change whole, when I select B, it will recalculate

If my slicer use TABLE2[Group] and I select B, Measure3 becomes blank, Measure1/2 look good but it still show all.

The second way is to use TABLE1[Group], it only shows B but the Measure2 and Measure3 is incorrect...

 

Any idea?

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @PeterChen 

 

You can try the following methods. Measure 1 No change.

Measure2 = RANKX(ALL(TABLE2[Group]), TABLE2[Measure1],,DESC)
Measure3 = DIVIDE([Measure2] - 1, COUNTROWS(ALL(TABLE2)) - 1)

vzhangti_0-1698827819774.png

 TABLE2[Group] as a slicer.

vzhangti_1-1698827870787.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @PeterChen 

 

You can try the following methods. Measure 1 No change.

Measure2 = RANKX(ALL(TABLE2[Group]), TABLE2[Measure1],,DESC)
Measure3 = DIVIDE([Measure2] - 1, COUNTROWS(ALL(TABLE2)) - 1)

vzhangti_0-1698827819774.png

 TABLE2[Group] as a slicer.

vzhangti_1-1698827870787.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

Ashish_Mathur
Super User
Super User

Hi,

I'd like to try.  Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Read about Filter Context.  Your card visual has no idea what SELECTEDVALUE means, so you need to help it expand the filter context back to the entire group when B is in context, for example via REMOVEFILTERS.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.