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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
selpaqm
Helper V
Helper V

Using Two Columns to get data

Hi,

I have a strange table and cannot get logic how to make it. Please check below table and what I need.

 

CustomerProductTest ResultextrasResult 
AAAxxxPass 1
BBByyyPassxxx1
AAAzzzFailxxx0
CCCxxxFail 0

 

now, I want to see that to create a measure and see test result percentage by product. if has no data on extras column there is no issue. however, for example for customer BBB there are two products yyy and xxx (it comes from extras column) so always pass affects both extras and product column result. 

in case I want to see yyy product pass rates it is ok 1 check and it passed. for zzz is same logic. but for xxx one I could not calculate the pass rate. the result should be for xxx is on product column there are 2 xxx and one failed and one passed, for extras column same on xxx so result should be 2/4=50%.  table at the report should look like 

Productpass rate
xxx50% (4 check 2 passed 2 failed)
yyy100%
zzz0%

and I will use this measure for both customers' products etc.

1 ACCEPTED SOLUTION
Bmejia
Super User
Super User

You can unpivot the data during the transformation so the two columns Product and extras are in one column. 
So you go from your original table above  to this:

Bmejia_0-1717179195504.png

 

Then just create a measure that divides number count of the total "Value" by total value results where it passed or 1.

PassRate =
VAR AllCount =  COUNTROWS(StrangeTable)
VAR PassCount = CALCULATE(COUNTROWS(StrangeTable),StrangeTable[Result ]=1)
RETURN
DIVIDE(PassCount ,AllCount,0)+0

 

View solution in original post

1 REPLY 1
Bmejia
Super User
Super User

You can unpivot the data during the transformation so the two columns Product and extras are in one column. 
So you go from your original table above  to this:

Bmejia_0-1717179195504.png

 

Then just create a measure that divides number count of the total "Value" by total value results where it passed or 1.

PassRate =
VAR AllCount =  COUNTROWS(StrangeTable)
VAR PassCount = CALCULATE(COUNTROWS(StrangeTable),StrangeTable[Result ]=1)
RETURN
DIVIDE(PassCount ,AllCount,0)+0

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.