SOLVED

DAX Challenge 1

Brass Contributor

Hi Every one

I have problem in written Dax formula in Pivot Table or Power BI
How can I Formula which its result be like the sample which I showed in attached Excel file,

I have Two item with the purchases invoice, and Purchase quantity is repeated in the file, 
I want a DA X Formula which it works correctly for Sum purchase quantity and sale Quantity, 

Also i want that its Supplier and Sale Date Filters in Slicers work correctly, 


Thank you for your cooperation in advance

7 Replies

@Jalal_1988 

Hi Jalal,

Please note that your answer in Pivot Table is not correct.

 

You may use different DAX Functions to solve your issue.

I used ADDCOLUMNS and Values Functions.

 

PBIX formatted files are not supported.

I can send you this pbix if you provide me with your e-mail addres.

 

However, the formula is as follows:

 

JalalsRequestTable = Addcolumns(Values(Jalal_1988[Item]), "PurchaseQuantity", [Sum_PurchaseQ-ty], "SalesQuantity", [Sum_SalesQ-ty])
I made to measures to make this table.
 
 
 
 

 

 

@Ilgar_Zarbaliyev  
Thank you Dear For you reply , Kinldy this is my Email " jalalrahimi87@yahoo.com " 
the result shroud be, please notice the Purchase quantity are repeated is sale records.  
Reslut in pivot  Table should be as:
Item  Pure Q      Sale Q
A       300           115
B       100             40

@Jalal_1988 

Hi there,

I sent you pbix file.

Good luck.

 

 

P.S. If you find my answer satisfactory and consider that it is your best answer, please mention it.

Thanks in advance.

 

 

Dear Ilgar

Please Notice that the Purchase quantity is repeated for each item with specific Purchase Invoice and Supplier,
you sale Quantity is True , But the Sum of Your Purchase quantity is False, the exact one is as i showed you in excel file ,
please find the correct Formula for me, /

Sincerely,
I want the exactly as i showed in below


Item Pure Q Sale Q

A 300 115

B 100 40
best response confirmed by Jalal_1988 (Brass Contributor)
Solution

@Jalal_1988 

Measures could be

Pure Q:=VAR qtyPerInvoice=SUMMARIZE (
          Range,
          Range[Item],
          Range[Purchase ivoice],
          "PurchaseQuantity", VALUES(Range[Purchase Quantity])
          )
RETURN SUMX( qtyPerInvoice, [PurchaseQuantity])

Sales Q:=SUM(Range[Sales Quantiy])

Result is

image.png

Please check in attached file.

Thank you Dear Baklan , It works Correctly ,
I appreciate your attention,

@Jalal_1988 , you are welcome

1 best response

Accepted Solutions
best response confirmed by Jalal_1988 (Brass Contributor)
Solution

@Jalal_1988 

Measures could be

Pure Q:=VAR qtyPerInvoice=SUMMARIZE (
          Range,
          Range[Item],
          Range[Purchase ivoice],
          "PurchaseQuantity", VALUES(Range[Purchase Quantity])
          )
RETURN SUMX( qtyPerInvoice, [PurchaseQuantity])

Sales Q:=SUM(Range[Sales Quantiy])

Result is

image.png

Please check in attached file.

View solution in original post