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
VANI_YN_80
Regular Visitor

DAX formula Help

Hi Everyone,

 

I have this Raw data and i want to calculate a new column called as PPC. The Formula for PPC is APP 2021 - APP2020 *Quantity posted 2021. 

 

could yop please help me with the formula ? This is my Raw Data.

C:\Users\Z002KNWX\Desktop\Purchase Variance analysis\New 

 

regards

Vani

1 ACCEPTED SOLUTION

Hi @VANI_YN_80 

 

Based on your data, you can create measures to get the result. 

total qty 2020 = SUM('Table'[Quantity posted in 2020])

gross value total 2020 = SUM('Table'[Gross value in local currency 2020])

APP 2020 = DIVIDE([gross value total 2020],[total qty 2020])

total qty 2021 = SUM('Table'[Quantity posted in 2021])

gross value total 2021 = SUM('Table'[Gross value in local currency 2021])

APP 2021 = DIVIDE([gross value total 2021],[total qty 2021])

PPC = [APP 2020] - [APP 2021] * [total qty 2021]

 

If you want to get the result with a single measure instead of above meaures, you can use below one. 

PPC 2 = DIVIDE(SUM('Table'[Gross value in local currency 2020]),SUM('Table'[Quantity posted in 2020])) - DIVIDE(SUM('Table'[Gross value in local currency 2021]),SUM('Table'[Quantity posted in 2021])) * SUM('Table'[Quantity posted in 2021])

080201.jpg

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as a solution to help other members find it.

View solution in original post

6 REPLIES 6
Samarth_18
Community Champion
Community Champion

Hi @VANI_YN_80 ,

Sorry to say, you have attached your local desktop url for raw data. Could you please upload your raw data file in sharepoint or one drive and share it so that other can access it.

or you could share some sample data with expected output snapshot this would also help.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi @Samarth_18 

 

thanks for the reply.

 

Below is the one drive link. Please check if you can access it. 

https://siemensapc-my.sharepoint.com/personal/vani_narasimhamurthy_siemens_com/_layouts/15/onedrive.... 

 

Regards

Vani 

Hi @VANI_YN_80 ,

Still its not accessible. You can just paste small set of data here with expected output, this will also help.

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi @Samarth_18 ,

 

Here is my sample data set.

 

Location ID : STORTFiscal year : GJAHRFiscal Period : FISCPERMaterial Number : MATNROrder Vendor ID : LIFNRPurchase order currency : BWAERGross value in local currency 2020Gross value in local currency 2021Quantity posted in 2020Quantity posted in 2021
4320202020003000000000001220508A1082278EUR2,860.00000 285.64299 
4320202020003000000000001220508A1082278EUR722.50000 72.15999 
4320202020012000000000001220508A1082278EUR3,546.59999 385.01900 
4320202020003000000000001220508A1082278EUR-228.80000 0.00000 
4320202020003000000000001220508A1082278EUR-57.79999 0.00000 
4320202020003000000000001220508A1082278EUR-228.80000 0.00000 
4320202020003000000000001220508A1082278EUR-57.79999 0.00000 
4320202020003000000000001220508A1082278EUR228.80000 0.00000 
4320202020003000000000001220508A1082278EUR57.79999 0.00000 
43202120210060000000000012205080010872860EUR 629.38999 3.99500
43202120210080000000000012205080010872860EUR 639.23000 4.05700
43202120210080000000000012205080010872860EUR 0.01000 0.00000

Here the output expected.

total qty 2020gross value total 2020APP 2020PPC  (APP 2020 - APP 2021 *total qty 2021
742.826842.5  
  9.211518268 
    
    
    
total qty 2021gross value total 2021APP 2021 
8.051268.63157.5937888-1259.42
    

 

Regards

Vani

Hi @VANI_YN_80 

 

Based on your data, you can create measures to get the result. 

total qty 2020 = SUM('Table'[Quantity posted in 2020])

gross value total 2020 = SUM('Table'[Gross value in local currency 2020])

APP 2020 = DIVIDE([gross value total 2020],[total qty 2020])

total qty 2021 = SUM('Table'[Quantity posted in 2021])

gross value total 2021 = SUM('Table'[Gross value in local currency 2021])

APP 2021 = DIVIDE([gross value total 2021],[total qty 2021])

PPC = [APP 2020] - [APP 2021] * [total qty 2021]

 

If you want to get the result with a single measure instead of above meaures, you can use below one. 

PPC 2 = DIVIDE(SUM('Table'[Gross value in local currency 2020]),SUM('Table'[Quantity posted in 2020])) - DIVIDE(SUM('Table'[Gross value in local currency 2021]),SUM('Table'[Quantity posted in 2021])) * SUM('Table'[Quantity posted in 2021])

080201.jpg

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as a solution to help other members find it.

Anonymous
Not applicable

hi @VANI_YN_80 ,

 

Unable to access the file. 

 

Thanks!

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.