Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I am currently working on the validation project. I have the following 2 sample modules in the PowerBI dashboard. In Table 1, column S_Contrib_R is a custom column created using the formula below to look up using Unique Key and populate the data from Table 2.
S_Contrib_R = CALCULATE(SUM('Table 2'[CONTRIB_Master]), FILTER('Table 2', 'Table 2'[Unique Key] = Table 1[Unique Key]))
My requirement is Same column i.e S_Contrib_R needs to be modified such way using conditional statement that: -
Please help me with the above conditional statement where I can look up table 2 and whichever condition gets satisfied it will populate the data using Unique Key as identifier.
Solved! Go to Solution.
Hi @Bansi008 .
Pleas try this:
formula =
VAR S_Contrib_R =
CALCULATE (
SUM ( 'Table 2'[CONTRIB_Master] ),
FILTER ( 'Table 2', 'Table 2'[Unique Key] = EARLIER ( 'Table 1'[Unique Key] ) )
)
VAR CONTRIB_R_MTD =
CALCULATE (
SUM ( 'Table 2'[CONTRIB_R_MTD] ),
FILTER ( 'Table 2', 'Table 2'[Unique Key] = EARLIER ( 'Table 1'[Unique Key] ) )
)
RETURN
IF (
'Table 1'[Purchase] = "P",
CONTRIB_R_MTD,
COALESCE ( CONTRIB_R_MTD, S_Contrib_R )
)
If this is not what you're looking for, please post a workable sample data (not an image) and your expected result using the same sample data.
Proud to be a Super User!
Hi @Bansi008 .
Pleas try this:
formula =
VAR S_Contrib_R =
CALCULATE (
SUM ( 'Table 2'[CONTRIB_Master] ),
FILTER ( 'Table 2', 'Table 2'[Unique Key] = EARLIER ( 'Table 1'[Unique Key] ) )
)
VAR CONTRIB_R_MTD =
CALCULATE (
SUM ( 'Table 2'[CONTRIB_R_MTD] ),
FILTER ( 'Table 2', 'Table 2'[Unique Key] = EARLIER ( 'Table 1'[Unique Key] ) )
)
RETURN
IF (
'Table 1'[Purchase] = "P",
CONTRIB_R_MTD,
COALESCE ( CONTRIB_R_MTD, S_Contrib_R )
)
If this is not what you're looking for, please post a workable sample data (not an image) and your expected result using the same sample data.
Proud to be a Super User!
Thanks, this perfectly works as expected.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
69 | |
46 | |
39 | |
33 |
User | Count |
---|---|
163 | |
110 | |
61 | |
51 | |
40 |