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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MIkkelHyldig
Helper II
Helper II

Dynamically return single value by columns

Hi, 

The end result should be: Item no 32 = 3000 quantity and not 9000 when I sum on Item No. 

The issue is that my table duplicates the quantity by the "Details" as quantity only relates to Doc and Item no level. 

Doc NoItem NoDetailsQuantityDatebatch ID
2321300027-01-211
2322300027-01-211
2323300027-01-211


I need a dynamically measure, so I can filter by details 1, 2 or 3 and still get quantity 3000. 

Thanks, 

Mikkel 



1 ACCEPTED SOLUTION
MIkkelHyldig
Helper II
Helper II

Hi all, 
I created a new table with unique item No to return a single value (e.g. 3000) and not sum by Details. 

View solution in original post

4 REPLIES 4
MIkkelHyldig
Helper II
Helper II

Hi all, 
I created a new table with unique item No to return a single value (e.g. 3000) and not sum by Details. 

v-angzheng-msft
Community Support
Community Support

Hi, @MIkkelHyldig 

 

Try to create a measure like this:

Measure = 
CALCULATE(
    // MIN('Table'[Quantity]),
    // MAX('Table'[Quantity]),
    AVERAGE('Table'[Quantity]),
    FILTER(ALLSELECTED('Table'),'Table'[Doc No]=MAX('Table'[Doc No])&&'Table'[Item No]=MAX('Table'[Item No]))
    )

 

Result:

vangzhengmsft_0-1638760079841.png

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

Hi and thanks for the reply. I found a solution by creating a new table with unique item no. Havent tried your solution 

lbendlin
Super User
Super User

Not clear if you need a sum of averages or something else.  Please provide sanitized sample data that fully covers your issue. 

Helpful resources

Announcements
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.