Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi, can anyone help me to transform below SQL formula to DAX?:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
QTY and Value Financial
while select sum(Qty), sum(CostAmountPosted), sum(CostAmountAdjustment),sum(costAmountPhysical),
itemId from inventTrans index itemIdx
group by itemId
where (inventTrans.DateFinancial <= transDate &&
inventTrans.DateFinancial != datenull())
{
if(inventTrans.Qty != 0 || (inventTrans.CostAmountAdjustment + inventTrans.CostAmountPosted) != 0)
{
select sum(CostAmountAdjustment) from settlement
group by itemId where settlement.ItemId == inventTrans.ItemId &&
settlement.TransDate <= transDate &&
settlement.SettleModel != inventSettlemodel::PhysicalValue;
inventTrans.Qty
settlement.CostAmountAdjustment + inventTrans.CostAmountPosted
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------
QTY and Value Physical
while select sum(Qty), sum(CostAmountPosted), sum(CostAmountAdjustment),sum(costAmountPhysical),
itemId from inventTrans
group by itemId
where
(inventTrans.DateFinancial == dateNull() ||
(inventTrans.DateFinancial > transDate)
&&
(inventTrans.DatePhysical != dateNull() &&
inventTrans.DatePhysical <= transDate))
{
inventTrans.Qty
inventTrans.costAmountPhysical
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------
PZ is later than FV
while select sum(Qty), sum(CostAmountPhysical),
itemId from inventTrans
group by itemId
where
inventTrans.DateFinancial <= transDate &&
inventTrans.DateFinancial != datenull() &&
inventTrans.DatePhysical > transDate
{
inventTrans.Qty
inventTrans.costAmountPhysical
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------
up
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
8 |