Forum Discussion
Multiple Return rows in SUMX
Hi All,
I am trying to write a DSO Countback DAX measure. My data table looks like below --
My requirement is to calculate the DSO values dynamically on the Country and Customer level using the same table.
My Dax works fine, but it return two set of values -- the formula uses two return statement
[o:2021.03,i:2021.03,ocurrARBal:25,icurrRev:40,Country:IN,icurrAR:25,revSUMXP:,revSUMX:40,pleft:25,cleft:-15,multiplier:0.625,result:18.75] |
[o:2021.03,i:2021.02,ocurrARBal:25,icurrRev:20,Country:IN,icurrAR:0,revSUMXP:40,revSUMX:60,pleft:-15,cleft:-35,multiplier:-0.75,result:0] |
[o:2021.03,i:2021.01,ocurrARBal:25,icurrRev:50,Country:IN,icurrAR:0,revSUMXP:60,revSUMX:110,pleft:-35,cleft:-85,multiplier:-0.7,result:0]
[o:2021.03,i:2021.03,ocurrARBal:25,icurrRev:40,Country:IN,icurrAR:25,revSUMXP:,revSUMX:40,pleft:25,cleft:-15,multiplier:0.625,result:18.75] |
[o:2021.03,i:2021.02,ocurrARBal:25,icurrRev:20,Country:IN,icurrAR:0,revSUMXP:40,revSUMX:60,pleft:-15,cleft:-35,multiplier:-0.75,result:0] |
[o:2021.03,i:2021.01,ocurrARBal:25,icurrRev:50,Country:IN,icurrAR:0,revSUMXP:60,revSUMX:110,pleft:-35,cleft:-85,multiplier:-0.7,result:0]
Please let me know where i am making mistake. It looks to me that the filter is ignoring the country values.
1 Reply
- v-yalanwu-msft
Community Support
Hi, Anonymous ;
I'm sorry that I couldn't determine the cause of the [SummaryAR] and [SummarySL] formula based on the information you gave me. The formula was not clear, so the test didn't go well. Second, can you share the results you want to export? Or provide a simple sample after removing sensitive information?
Try it?
Measure = SUMX(FILTER(ALL('DSO_AR_SALES'),[Country]=MAX('DSO_AR_SALES'[Country])&&[Customer]=MAX('DSO_AR_SALES'[Customer])),[DsO(CB)])The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.