cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Display two rows with multiple column values

I have three tables in my model: resultProcess As T1 visual (PK: ProcessID), resultWorkflow As T2 visual (FK: ProcessID, WorkflowNr), resultFeatureCount As T3 visual (FK: ProcessID, WorkflowNr). resultProcess table has zero to many workflows in resultWorkflow and resultFeatureCount tables

 

When I choose a row in T1 visual, T2 rows (127 rows) gets filtered based on relationships. Currently, T3 is not related to any table and I used the filter pane to show what I wanted to accomplish.

 

In T2 visual (Test Results by Workflow), the rows are filtered by ProcessID. Each process have no more than 127 workflow numbers (1-127)

 

My problem is in T3 visual (Test Results by Workflows with Feature Counts). Assuming there's a relationship with T1, when I pick on a row in T2, T3 gets filtered with its related ProcessID and WorkflowNr row in T3. When I click on the COMPARE button, I'd like to show the static Baseline row for the corresponding WorkflowNr selected in T2. This is the boxed row in T3 visual.

 

I'm looking for suggestions on how to implement this. Baseline rows are also on T3 and they have a Baseline attribute value = Yes. I was thinking of just moving this attribute value from Baseline to ProcessID attribute but the challenge is when I slice with a row on T2, only one row gets picked on T3.  It can be as simple as selecting a row in T2 and the baseline and test result of the corresponding workflow are next to each other in T3 only. Unlike what I show where all the workflows are visible.

PBI question.png

After I have the two rows on T3, I'd like to highlight the deltas on each column with conditional formatting.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Display two rows with multiple column values

Hi @rena9994 ,

 

We create a sample and you can refer this way,

 

1. Delete the relationship between resultProcess and resultFeatureCount.

 

Dis 1.jpg

 

2. Then we can create a measure in resultFeatureCount table.

 

Measure = 
var selected_ = MIN('resultProcess'[ProcessID])
var max_name = MAXX(FILTER(ALLSELECTED('resultFeatureCount'),'resultFeatureCount'[ProcessID]=selected_),'resultFeatureCount'[name])
return
CALCULATE(SUM(resultFeatureCount[value]),FILTER('resultFeatureCount', 'resultFeatureCount'[name]=max_name))

 

The result like this,

 

Dis 2.jpg

 

Dis 3.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample  based on fake data or describe the fields of each tables and the relations between tables simply?

 

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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
Highlighted
Super User IV
Super User IV

Re: Display two rows with multiple column values

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Microsoft
Microsoft

Re: Display two rows with multiple column values

Hi @rena9994 ,

 

We create a sample and you can refer this way,

 

1. Delete the relationship between resultProcess and resultFeatureCount.

 

Dis 1.jpg

 

2. Then we can create a measure in resultFeatureCount table.

 

Measure = 
var selected_ = MIN('resultProcess'[ProcessID])
var max_name = MAXX(FILTER(ALLSELECTED('resultFeatureCount'),'resultFeatureCount'[ProcessID]=selected_),'resultFeatureCount'[name])
return
CALCULATE(SUM(resultFeatureCount[value]),FILTER('resultFeatureCount', 'resultFeatureCount'[name]=max_name))

 

The result like this,

 

Dis 2.jpg

 

Dis 3.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample  based on fake data or describe the fields of each tables and the relations between tables simply?

 

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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

Highlighted
Frequent Visitor

Re: Display two rows with multiple column values

Thanks for the sample PBIX and your reply.  Your sample provides the answer on how to solve my problem. If I understood it correctly, one can filter a table based on a selected filter that is passed to a measure. While your sample did not exactly answer my problem, it gave me the path to the solution. Thanks again! I'll see if I can do it myself. 

Highlighted
Frequent Visitor

Re: Display two rows with multiple column values

I tried to build the measure but can't seem to get it right.

 

Below I show what I want to accomplish. When I select ProcessID in the slicer, below happens:

  1. Yellow highlights - [Test Runs] and [Test workflow] visuals are filtered by 'ProcessId' 
  2. Pink highlights - In the [Results] table, a measure called Slicer assigns a value '0' for rows where (Baseline = 'Yes') or (ProcessID = selected (ProcessID)) in the slicer (e.g. 1068)
  3. Blue highlights - [Workflows - Baseline vs Results] table visual - [Results] table - is filtered by Slicer value = '0' based on Visual filter.er 

 

Annotation 2020-06-05 143654.png

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors