Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Following DAX is giving me an error. Please help
GP Yeild KG =
var prodA=divide ( CALCULATE(Sum(DBALLSTAT[Profit])),CALCULATE(Sum(DBALLSTAT[ChglWt(KG)]),Group_Logic[Mode_group_3]="AIR"))
var prodB=Divide(CALCULATE(Sum(DBALLSTAT[Profit])),CALCULATE(Sum(DBALLSTAT[Tues]),Group_Logic[Mode_group_3]="OCEAN"))
var ProdC=divide(CALCULATE(Sum(DBALLSTAT[Profit])),CALCULATE(Sum(DBALLSTAT[ChglWt(KG)])) )
var ProdD= if([Mode_group_3]="Air",divide(prodA,prodB),Divide(ProdA,ProdC))
return ProdD
Solved! Go to Solution.
var prodA= CALCULATE(Sum(DBALLSTAT[Profit])) var ProdA1=CALCULATE(Sum(DBALLSTAT[ChglWt(KG)]))
var prodB=CALCULATE(Sum(DBALLSTAT[Profit])) var ProdB2=FLOOR(CALCULATE(sum(DBALLSTAT[Tues]) +(sum(DBALLSTAT[CBM])/25)),1)
var ProdC=CALCULATE(Sum(DBALLSTAT[Profit])) var ProdC2=CALCULATE(Sum(DBALLSTAT[ChglWt(KG)]))
var ProdD= if (SELECTEDVALUE(Group_Logic[Mode_group_1])="AIR",divide(prodA,ProdA1), if(SELECTEDVALUE(Group_Logic[Mode_group_1])="OCEAN",divide(ProdB,ProdB2),divide(ProdC,ProdC2)))
@sakshikaul , You have to change var ProdD like this and try
var ProdD= if(max([Mode_group_3])="Air",divide(prodA,prodB),Divide(ProdA,ProdC))
Still getting the error
@sakshikaul , use SELECTEDVALUE instead max
ProdD= if(SELECTEDVALUE([Mode_group_3])="Air",divide(prodA,prodB),Divide(ProdA,ProdC))
Regards,
Manikumar
Proud to be a Super User!
Hi@sakshikaul,
According to the image you provided, the highlighted section needs to be re-referenced, and not referencing the column correctly is causing this error.
Hope it helps.
Best Regards,
Caitlyn Yan
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I have referenced to a column name but still not getting the output .
When I am Selecting filter Mode as AIR. I am getting the output but when selecting Mode = OCEAN then I am getting blank values
when Filter Mode=AIR
var prodA= CALCULATE(Sum(DBALLSTAT[Profit])) var ProdA1=CALCULATE(Sum(DBALLSTAT[ChglWt(KG)]))
var prodB=CALCULATE(Sum(DBALLSTAT[Profit])) var ProdB2=FLOOR(CALCULATE(sum(DBALLSTAT[Tues]) +(sum(DBALLSTAT[CBM])/25)),1)
var ProdC=CALCULATE(Sum(DBALLSTAT[Profit])) var ProdC2=CALCULATE(Sum(DBALLSTAT[ChglWt(KG)]))
var ProdD= if (SELECTEDVALUE(Group_Logic[Mode_group_1])="AIR",divide(prodA,ProdA1), if(SELECTEDVALUE(Group_Logic[Mode_group_1])="OCEAN",divide(ProdB,ProdB2),divide(ProdC,ProdC2)))
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 42 | |
| 35 | |
| 35 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 65 | |
| 58 | |
| 28 | |
| 27 | |
| 25 |