Forum Discussion
Anonymous
6 years agoNot applicable
SQL to DAX Convert
Hello, I'm new to DAX, please help to convert below T-SQL code to its equivalnet DAX. I 'm generating running total (cummulative) using TSQL the same i need in DAX, please help selec...
- 6 years ago
Hi Anonymous ,
Modify the formula like this:
EVALUATE VAR tab = SUMMARIZE( FILTER( 'Inv_Fact_Inventory', 'Inv_Fact_Inventory'[Dashboard] = "Current Inventory" && 'Inv_Fact_Inventory'[Inventory Order Type] = "TENDERED" && 'Inv_Fact_Inventory'[Inventory Status] = "ASSIGNED" ), 'Inv_Fact_Inventory'[Received Date], "Units Assigned", CALCULATE(COUNT(Inv_Fact_Inventory[CURINV_CARGO_ID])) ) RETURN SELECTCOLUMNS( tab, "Final_Cut", var d = 'Inv_Fact_Inventory'[Received Date] return SUMX( FILTER( tab, [Received Date] <= d ), [Units Assigned] ) ) order by [Final_Cut] descYou may get your expected result, below is my sample and result:
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
6 years agoSuper User
Anonymous , Try like
sumx(values(Table[Received Date]), calculate(count(Table[CARGO_ID]),filter(Table, table[Status]="ASSIGNED" && table[Type]="TENDERED" && table[Dashboard]="Inventory")))
Anonymous
6 years agoNot applicable
Its not working.
I'm not getting values based on the formula that you have provided.