Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I'm relatively new to Power BI and need to build a report that shows which suppliers are on contract in order to compare the total spend versus contracted spend as a value & a percentage.
Example tables:
Table 1
| Supplier Number | Total Spend |
| A123 | £98 |
| B123 | £94 |
| C123 | £100 |
| D123 | £88 |
Table 2
| Supplier Number |
| A123 |
| B123 |
| D123 |
What I want to show
| Supplier Number | Total Spend | Contracted Spend |
| A123 | £98 | £98 |
| B123 | £94 | £94 |
| C123 | £100 | |
| D123 | £88 | £88 |
| Total | £380 | £280 |
Using the sum of each column I will create a Card that shows the percentage of contracted spend so in this example the contract spend would be 73.68%
Please help!
Solved! Go to Solution.
@rmblack92 It looks like you have only some of your suppliers in the DimSupplier table - defined as 'Contracted Spend'. Do you have the non-contracted suppliers in a table somewhere too? It would be handy to have this info in one table. I've created a sample report, but I'm using the SupplierID from the Spend table which is not generally a good idea.
You can create a measure like this;
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi @rmblack92
BTW, you can use HASONEVALUE() to get the expected result,
Contracted Spend = IF(HASONEVALUE(Table1[Supplier Number]),CALCULATE(MIN(Table1[Total Spend (£)]),FILTER(Table1,RELATED(Table2[Supplier Number])<>BLANK())),[Contracted Spend Total])
See sample file attached bellow.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@rmblack92 It looks like you have only some of your suppliers in the DimSupplier table - defined as 'Contracted Spend'. Do you have the non-contracted suppliers in a table somewhere too? It would be handy to have this info in one table. I've created a sample report, but I'm using the SupplierID from the Spend table which is not generally a good idea.
You can create a measure like this;
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |