cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper II

## Calculate filter OR

Item Last Cost =
calculate(AVERAGE( Products[last_cost] ),
FILTER(Bi_Balance_All,not(ISBLANK([Units at Stock])))
||

what's wrong here?! why i can't use or with this code?!!
8 REPLIES 8
Super User

I hope this message finds you well. I've noticed that this solution remain unresolved. If any of you have managed to find a resolution to the issue, I kindly request that you share your solution for the benefit of the entire community. Alternatively, if you're still facing challenges, please do let us know as well.

Your insights and updates will greatly assist others who might be encountering the same challenge.

Super User

Hi,

Share data in a format that can be pasted in an MS Excel file, explain the question and show the expected result.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Helper II

Super User

Hi,

In the Query Editor, append the 2 tables (call that table Data).  Create a single column table with all unique Names (call this table Names).  Create a many to one relationship from the Data table and Product table to the Names table.  To your visual, drag Name from the Names table.  Write this measure

Measure = if(sum(Data[Balance])=0,blank(),sum(Product[Price]))

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Helper II

i can't actullay do that, it's ver complicated cube with alot of relationships, i just tried to simplfy as mush as i can, but iused another measure

VAR not_in_Scope = not(ISINSCOPE(Products[Item]))
return
if(Check_=TRUE() || not_in_Scope = True() ,blank(),AVERAGE(Products[last_cost]))

------------------------------------------------------------------------
VAR balance = CALCULATE(AVERAGE(Products[last_cost]), FILTER(Bi_Balance_All,not(isblank([Units at Stock]))))
return

they both worked, i juts can't imagine that i can't use or with calculate and filter?!!!!
Super User

I can only assume based on your dax that both tables filter the Products table. If this is the case you can try

=
AVERAGEX (
FILTER (
Products,
NOT ISBLANK ( RELATED ( Bi_Balance_All[Units at Stock] ) )
),
Products[last_cost]
)

Super User

Hi @Amrselim1989 ,

Try this kind of structure:

Measure =
calculate(AVERAGE( 'Table'[Value] ),
FILTER('Table (2)',not(ISBLANK([Units at Stock]) || not(ISBLANK([Basket Uints])))))

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

Proud to be a Super User!

Helper II

no i can't the Basket Uints is coming from another table not table 2

calculate(AVERAGE( 'Table'[Value] ),
FILTER('Table (2)',not(ISBLANK([Units at Stock]) || "here must choose another table (not table 2)"not(ISBLANK([Basket Uints])))))

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors