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

Excel formula to DAX

Hi

Demand-ID DemandSupplyOS FlagUnfulfilledTotal SupplySupply Zero/Non-ZeroTotal UnfulfilledUnfulfilled Zero/Non-Zero
1 42N24Non-Zero0Zero
2 107N39Non-Zero1Non-Zero
3 60N60Zero6Non-Zero
1  2Y-2DNCDNCDNCDNC
2  2Y-2DNCDNCDNCDNC
3  0Y0DNCDNCDNCDNC

 

in the above mentioned table for total supply we are using a formula =IF(E2="N", D2+XLOOKUP(A2,$A$2:$A$7,$D$2:$D$7,"NA",0,-1),"DNC")

 

Can anyone suggest a respective dax for the above excel formula.

Thank you,

6 REPLIES 6
Ahmedx
Super User
Super User

can you explain, F21 is the OS Flag column?
and $B$12:$B$17 is which column?

and$E$12:$E$17 is which column?

Hi

F21=OS Flag column

$B$12:$B$17=Demand-ID column

$E$12:$E$17 = Supply column

Ahmedx
Super User
Super User

post the excel file, your formula is so unclear

IF(E2="N"

IF(F12="N"

Hi

Row no.Demand-ID DemandSupplyOS FlagUnfulfilledTotal SupplySupply Zero/Non-Zero
1200027_MS-106365_202230 0.050.05N=D21-E21=IF(F21="N", E21+XLOOKUP(B21,$B$12:$B$17,$E$12:$E$17,"NA",0,-1),"DNC")=IFS(H21=0,"Zero",H21="DNC",H21,TRUE,"Non-Zero")
1300027_MS-106365_288764 0.10N=D22-E22=IF(F22="N", E22+XLOOKUP(B22,$B$12:$B$17,$E$12:$E$17,"NA",0,-1),"DNC")=IFS(H22=0,"Zero",H22="DNC",H22,TRUE,"Non-Zero")
1400014_MS-106365_305428 42N=D23-E23=IF(F23="N", E23+XLOOKUP(B23,$B$12:$B$17,$E$12:$E$17,"NA",0,-1),"DNC")=IFS(H23=0,"Zero",H23="DNC",H23,TRUE,"Non-Zero")
1500027_MS-106365_202230  2Y=D24-E24=IF(F24="N", E24+XLOOKUP(B24,$B$2:$B$7,$E$2:$E$7,"NA",0,-1),"DNC")=IFS(H24=0,"Zero",H24="DNC",H24,TRUE,"Non-Zero")
1600027_MS-106365_288764  2Y=D25-E25=IF(F25="N", E25+XLOOKUP(B25,$B$2:$B$7,$E$2:$E$7,"NA",0,-1),"DNC")=IFS(H25=0,"Zero",H25="DNC",H25,TRUE,"Non-Zero")
1700014_MS-106365_305428  0Y=D26-E26=IF(F26="N", E26+XLOOKUP(B26,$B$2:$B$7,$E$2:$E$7,"NA",0,-1),"DNC")=IFS(H26=0,"Zero",H26="DNC",H26,TRUE,"Non-Zero")

 

 

Row no.Demand-ID DemandSupplyOS FlagUnfulfilledTotal SupplySupply Zero/Non-Zero
1200027_MS-106365_202230 0.050.05N02.05Non-Zero
1300027_MS-106365_288764 0.10N0.12Non-Zero
1400014_MS-106365_305428 42N22Non-Zero
1500027_MS-106365_202230  2Y-2DNCDNC
1600027_MS-106365_288764  2Y-2DNCDNC
1700014_MS-106365_305428  0Y0DNCDNC
Ahmedx
Super User
Super User

Share some data to work with (in a format the can be pasted in an MS Excel file) and show the expected result.

Hi

 

Row no.Demand-ID DemandSupplyOS FlagUnfulfilledTotal SupplySupply Zero/Non-ZeroTotal UnfulfilledUnfulfilled Zero/Non-Zero
1200027_MS-106365_202230 0.050.05N02.05Non-Zero-2Non-Zero
1300027_MS-106365_288764 0.10N0.12Non-Zero-1.9Non-Zero
1400014_MS-106365_305428 42N22Non-Zero2Non-Zero
1500027_MS-106365_202230  2Y-2DNCDNCDNCDNC
1600027_MS-106365_288764  2Y-2DNCDNCDNCDNC
1700014_MS-106365_305428  0Y0DNCDNCDNCDNC

 

 

Here the formula  used for total supply is =IF(F12="N", E12+XLOOKUP(B12,$B$12:$B$17,$E$12:$E$17,"NA",0,-1),"DNC")

 

and I need to import this total supply column in powerbi so I need a suitable dax

 

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.