Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jesly_ajin
Helper III
Helper III

Get sum ignoring the relationship in Power BI

Dears,

 

There is Many- Many Relation between the Hour & Quantity table.

There is project and date and resource type (labor or equipment) slicer which is getting filtered on the Power bi graph.

 

I need the quantity for a task to be calculated as below.

Kindly help.

Now since in the Hour table there is only 4 lines, the quantity in power bi is calculated only for 4 lines.

I need the quantity to be calculated for each task irrespective of lines in hour table but must get filtered for project, date and resource type.

 

NeededBI.JPG

1 ACCEPTED SOLUTION

@jesly_ajin ,

 

You may try dax below if you have a slicer on [id] column:

Total_Qty =
CALCULATE (
    SUM ( Quantity[qty] ),
    FILTER ( ALL ( Quantity ), Quantity[id] IN VALUES ( Quantity[id] ) )
)

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yuta-msft
Community Support
Community Support

@jesly_ajin ,

 

Create measures like pattern below:

Total_Qty =
CALCULATE ( SUM ( Quantity[qty] ), ALL ( Quantity ) )

Total_Qty =
CALCULATE ( SUM ( Hour[hours] ), ALL ( Hour ) )

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yuta-msft ,

ALL is ignoring the slicer filters too, i want the value to be filtered with slicer filter.

Will crossfilter help me with this? I need examples or links to understand it better.

@jesly_ajin ,

 

You may try dax below if you have a slicer on [id] column:

Total_Qty =
CALCULATE (
    SUM ( Quantity[qty] ),
    FILTER ( ALL ( Quantity ), Quantity[id] IN VALUES ( Quantity[id] ) )
)

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jesly_ajin
Helper III
Helper III

Please help. I am really in need for solutions and suggestions. Appreaciate your response

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.