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
julesdude
Post Partisan
Post Partisan

Find percentage of latest item reference (by date) by it's group name

Hi,

 

I have the following table in my data model, made simple here:

 

Table1:

Item Value

Item Ref  Item Value  Value Date  Supplier Ref
1  20  13/04/2021  Name1
1  15  15/02/2022  Name1
1  25  15/07/2019  Name1
2  45  25/04/2019  Name1
2  40  01/02/2020  Name1
2  30  15/09/2021  Name1
3  22  29/10/2020  Name2
3  21  13/09/2019  Name2

 

In my report, I want to display a table which takes only the latest Value for each Item Ref (using the latest Value Date) and then gives the percentage of it's value against all the other items with the same Supplier Ref.

 

I am aiming for a result in my report that looks like this:

 

Item Ref  Item Percentage
1  33%
2  66%
3  100%


 Logic would need to take the last dated Item ref, total all item refs that belong to the supplier ref group and find out their individual percentage part of it.

 

I was trying to adapt the DAX below to fit my example but couldn't get it working and not sure if it's the right approach?

 

Percent = DIVIDE ( SUMX ( 'Table', 'Table'[Value] ), CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Name] ) ) )

 

Grateful for any help please.

1 ACCEPTED SOLUTION

Unfortunately a duplicate post (this one had wrongly been marked as spam).

 

The solution was found here:

 

DAX required to provide percentage of a latest dat... - Microsoft Power BI Community

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

what if an item has multiple supplier refs?

Unfortunately a duplicate post (this one had wrongly been marked as spam).

 

The solution was found here:

 

DAX required to provide percentage of a latest dat... - Microsoft Power BI Community

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.

Top Solution Authors