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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ustas55
Helper I
Helper I

Reference results from one table (visual) in other

Good Day Professionals,

I’ve been trying to find a solution on how to reference a value of the measure from one visual (table) into another.

 

In my example, I have a transaction table with Rep, Customer, Item, Actual Price, and Target Price. I have a measure (Rate %) defined as DIVIDE(Actual Price M, Target Price M). “Actual Price M” and “Target Price M” are measures also.

 

In my table (visual) “Customer – Rate” I can see Rate by a Customer. I would like to use result of this visual, and create another visual (ideally a histogram), which will perform count of Customers by Rate, which falls into the range of “Rate Ranges” table. Ultimately, Range 50% – 100% should have count of 4, Range 100% - 150% should have count of 3, etc.

image.pngimage.png

 

I’m attaching a link to the model, perhaps it would be easier to see.

Thank you in advance for your recommendation.

 

https://drive.google.com/file/d/1140QrqCVsFNs509uxuNCjKp7PJCWd-Kv/view?usp=sharing 

 

Best Regards,

Sam

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Create a column chart with Range Name on the x-axis and put a measure that counts the customers in that range in the Values field.

AlexisOlson_0-1625089691526.png

I defined this measure as follows:

 

CustCont =
VAR MinVal = SELECTEDVALUE ( 'Rate Ranges'[Value] )
VAR MaxVal = SELECTEDVALUE ( 'Rate Ranges'[Value2] )
RETURN
    COUNTROWS ( FILTER ( Customer, [Rate] >= MinVal && [Rate] < MaxVal ) )

 

If you don't want to hide ranges with no customers, just add "+0" to the end of the measure so that it returns zero rather than blank for those cases.

 

Edit: Note that this does not actually reference any other visuals. See this recent thread for further discussion about that: https://community.powerbi.com/t5/Desktop/Is-It-Possible-to-Call-Refer-to-the-quot-Table-quot/m-p/193...

View solution in original post

3 REPLIES 3
ustas55
Helper I
Helper I

Thank you Alexis.

I guess DAX is the KING!!!

One follow up question that I have.... how/where can I specify sort order of the X Axes. Do I need to define a sequence in the "Rate Range" table?

 

Best Regards,

Sam

.... Actually I've found a solution to my own issue: "More Option" on the visual, and "Sort By" did the trick.

AlexisOlson
Super User
Super User

Create a column chart with Range Name on the x-axis and put a measure that counts the customers in that range in the Values field.

AlexisOlson_0-1625089691526.png

I defined this measure as follows:

 

CustCont =
VAR MinVal = SELECTEDVALUE ( 'Rate Ranges'[Value] )
VAR MaxVal = SELECTEDVALUE ( 'Rate Ranges'[Value2] )
RETURN
    COUNTROWS ( FILTER ( Customer, [Rate] >= MinVal && [Rate] < MaxVal ) )

 

If you don't want to hide ranges with no customers, just add "+0" to the end of the measure so that it returns zero rather than blank for those cases.

 

Edit: Note that this does not actually reference any other visuals. See this recent thread for further discussion about that: https://community.powerbi.com/t5/Desktop/Is-It-Possible-to-Call-Refer-to-the-quot-Table-quot/m-p/193...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.