Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi in the above, i have in yellow a material with the same code coming from two suppliers and in blue i have a amaterial which have different code and is coming from different buyers. I have used the below DAX to for "total Buom_act_distreceipts_2 and Actual_vendor_percentage"
1. Duplicated the column
2. Splitted that Material Copy column and Transformed to be upper text to mach your Vendor Upper Text-
3. Duplicated the vendor, splitted it too
4. Finally said if there is a match, then use the new material column, if no, the original.
Now you can use this Mat column for calculation.
Check this out, you have the name of the vendor in your Mat Description, you create a duplicate of your material and split it into the first part until vendor and last part with vendor, then you split the vendor column into one part of the vendor itself, then you compare them, if it is the same, then you take the base Mat description, without vendor name, if they are not the same then you take material as it was.
Might be a bit confusing, but check the power query and if you still have questions, let me know.
Thanks Olgad, I have applied the power query and achieved a common Material description for both materials as highlighted below. However the Total receipts are still summed up individually
the only thing that comes to my mind, go back to power query , select Material description and trim it, may be a space is left somewhere and pbi still treats it as two separate materials.
because we have identical measure and for me it works
Thank you Olgad, been very helpful! I trimed and for some reason i seem to get the right total receipt now. However it seem to be static and not affected when you play around with the date as seen in the second screenshot
Hi @Henry2023 ,
Thank you @olgad for the quick response and solution. Here are some of my additions:
Please try this measure:
Total Receipts =
var NumofVendors=CALCULATE(COUNT(bw_csp_act[vendor]),ALLSELECTED(bw_csp_act[vendor]))
var NumofMaterial=CALCULATE(COUNT(bw_csp_act[MatNr]),ALLEXCEPT(bw_csp_act,'bw_csp_act'[Material-Description]))
RETURN
IF(NumofVendors>1,
CALCULATE(SUM('bw_csp_act'[BUoM_Act_DistrReceipts]),ALLSELECTED('bw_csp_act'[vendor])),
IF(NumofMaterial>1,CALCULATE (
SUM ( bw_csp_act[BUoM_Act_DistrReceipts] ),
FILTER (
ALLSELECTED ( bw_csp_act ),
bw_csp_act[Material-Description]
= SELECTEDVALUE ( bw_csp_act[Material-Description] )
)),SUM(bw_csp_act[BUoM_Act_DistrReceipts])))
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Olgad, This is amazing and i think it will solve the problem. I have had a look at the Pbix file and it looks great. Kinda confused on the power query part, could you help me with the power query you made use of in this example? Otherwise i can try to figure it out and let you know if it works for me. Thanks a bunch!
Hi,
provided you have the same material number or description, because right now your material description is technically different because it contains vendor names, you can use the following:
Thank you Olgad, appreciate your response. You are totally right as these materials appear to be different in all attribute(code, description and vendor). However it is a peculiar situation i have been tasked with and my understanding is that i have to find something unique to these materials or create something unique myself. Your query however works where i have same description, thanks. If you think of something else that can help in this situation, i'd appreciate the thought.
User | Count |
---|---|
52 | |
51 | |
20 | |
17 | |
16 |
User | Count |
---|---|
113 | |
45 | |
44 | |
28 | |
22 |