Forum Discussion
Show % based on 2 tables
- 6 years ago
You could consider merging those two tables to make the calculation even easier with the first measure. If not, the second measure should work with no relationship between the tables.
Measure1 = calculate(countrows(MergedTable), MergedTable[Success] = "Yes")/countrows(MergedTable)
Measure2 = var denominator = countrows(TotalOrderTable)
var numerator = calculate(countrows(OrderTable), treatas(values(TotalOrderTable[OrderNumberColumn]), OrderTable[OrderNumberColumn]))
return numerator/denominator
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- 6 years ago
Hi,
Would you please try to use the following measure:
Measure = VAR a = COUNTROWS ( 'Table' ) VAR b = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALL ( 'Table' ), 'Table'[Total Order] IN VALUES ( Table2[Order] ) && LOOKUPVALUE ( Table2[Success], Table2[Order], 'Table'[Total Order] ) = "Yes" ) ) RETURN b / aFor more details, please refer to https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EW2exHt7NIZCkM_JNaHiHfgBs_uIdUTJPY2-ek_HOdSo7g?e=bgoeth
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi,
Would you please try to use the following measure:
Measure =
VAR a =
COUNTROWS ( 'Table' )
VAR b =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[Total Order] IN VALUES ( Table2[Order] )
&& LOOKUPVALUE ( Table2[Success], Table2[Order], 'Table'[Total Order] ) = "Yes"
)
)
RETURN
b / a
For more details, please refer to https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EW2exHt7NIZCkM_JNaHiHfgBs_uIdUTJPY2-ek_HOdSo7g?e=bgoeth
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai