Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am trying to create a measure whereby I sum values from one table only if a record exists in another table. See below for example.
In this example, I want to sum values in the Sales table, according to Month but I only want to do it if the record in the Product column appears in the Products table (also ignoring blank product lines from Sales table).
Ideas please? 🙂
Solved! Go to Solution.
Hi @robg89 ,
If you want to create a new column:
SUM =
CALCULATE (
SUM ( Sales[Value] ),
FILTER (
ALL ( Sales ),
Sales[Month] = EARLIER ( Sales[Month] )
&& Sales[Prodect] <> BLANK ()
&& LOOKUPVALUE ( Project[Product], Project[Product], Sales[Prodect] ) <> BLANK ()
)
)
And if masure:
SUM1 =
CALCULATE (
SUM ( Sales[Value] ),
FILTER (
ALL ( Sales ),
Sales[Month] = MAX ( Sales[Month] )
&& Sales[Prodect] <> BLANK ()
&& LOOKUPVALUE ( Project[Product], Project[Product], Sales[Prodect] ) <> BLANK ()
)
)
Base table:
Output result:
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @robg89 ,
If you want to create a new column:
SUM =
CALCULATE (
SUM ( Sales[Value] ),
FILTER (
ALL ( Sales ),
Sales[Month] = EARLIER ( Sales[Month] )
&& Sales[Prodect] <> BLANK ()
&& LOOKUPVALUE ( Project[Product], Project[Product], Sales[Prodect] ) <> BLANK ()
)
)
And if masure:
SUM1 =
CALCULATE (
SUM ( Sales[Value] ),
FILTER (
ALL ( Sales ),
Sales[Month] = MAX ( Sales[Month] )
&& Sales[Prodect] <> BLANK ()
&& LOOKUPVALUE ( Project[Product], Project[Product], Sales[Prodect] ) <> BLANK ()
)
)
Base table:
Output result:
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @robg89
Can you please give the below measure a try
CALCULATE(SUM(Table1[value]),NOT(ISBLANK(TABLE1[Product])))
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
It doesn't work I am afraid.. I assume you need to reference the Product table in the ISBLANK formula?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
57 | |
36 | |
34 |
User | Count |
---|---|
99 | |
56 | |
56 | |
46 | |
40 |