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.
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.
Solved! Go to 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
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |