Forum Discussion
IF Statement - Two tables - No relationship - Help needed!
- Anonymous5 years ago
Hi Anonymous ,
Please update the formula of your calculated column as below:
new column =
VAR _count =
COUNTX (
FILTER (
'membership_package',
1 = 1 //please add the proper condition here
&& 'appended_table'[lwin11_count] > 'membership_package'[annual_data_allowance]
),
'appended_table'[lwin11_count]
)
RETURN
IF ( _count > 0, "Exceeded", "Within Limit" )If the above one is not working, please provide the relationship fileds which these four tables created the relationship base on and some sample data (exclude sensitive data) from them. And 'appended_table'[lwin11_count] and'membership_package'[annual_data_allowance] is a one-to-one relationship, that is, one 'appended_table'[lwin11_count] corresponds to only one'membership_package'[annual_data_allowance] value? It is better if you can provide your sample pbix file(exclude sensitive table) if it is convenient. Thank you.
Best Regards
Hi Anonymous ,
As checked your sample pbix file, what you are creating is a measure not a calculated column. Please create a calculated column with the below formula just as shown in below screenshot:
UNDERSTANDING THE DIFFERENCES BETWEEN CALCULATED COLUMNS & MEASURES IN POWER BI
Calculated Columns and Measures in DAX
Best Regards
Hi Anonymous,
Good spot! thank you. It appears to be only showing exceeded for them all and not within limit?
kind regards,
Syed Mahmood
- Anonymous5 years agoNot applicable
Hi Anonymous ,
Please create a calculated column as below to get it, you can find the details in the attachment.
Column = VAR _midmp = 'appended_table'[m_id] VAR _mercid = CALCULATE ( MAX ( 'merchant_group'[merchant_id] ), FILTER ( 'merchant_group', 'merchant_group'[m_id] = _midmp ) ) VAR _prefvalue = CALCULATE ( MAX ( 'merchant_broker_pref'[pref_value] ), FILTER ( 'merchant_broker_pref', 'merchant_broker_pref'[mg_id] = _mercid ) ) VAR _ada = CALCULATE ( MAX ( 'membership_package'[annual_data_allowance] ), FILTER ( 'membership_package', FORMAT ( 'membership_package'[id], "#" ) = _prefvalue ) ) RETURN IF ( _ada = BLANK (), BLANK (), IF ( 'appended_table'[lwin11_count] > _ada, "Exceeded", "Within Limit" ) )Best Regards
- Anonymous5 years agoNot applicable
Thank you so much Anonymous, you the best!
- Anonymous5 years agoNot applicable
Hi Anonymous ,
On further review, it seems to be miss classifying some. if you compare lwin_11 to the annual limit some arent correctly classified. Please could you re-look? or maybe its something from my side.
- Anonymous5 years agoNot applicable
Anonymous