在将表格传递给XIRR函数之前,DAX调试器创建的预览表格。

huangapple go评论186阅读模式
英文:

Preview Table created by DAX before it's passed into XIRR function - DAX Debugger

问题

我们一直在尝试在PowerBI中使用XIRR函数,并在一个月的时间里尝试了各种方法来使其正常工作。最终,我们成功解决了XIRR函数的错误问题。对于一些ID,它返回的IRR似乎对我们的测试数据来说是合理的,但对于其他ID来说,IRR看起来过高。

我并不是在寻求关于XIRR函数本身的帮助。由于XIRR的第一个参数是一个表格,我想知道是否有一种方法可以预览PowerBI将使用DAX和联合操作组装的计算表格,以便我可以看到原始数据传递给XIRR DAX函数的情况。

正如我所说,我并不是在寻求关于XIRR的帮助,但如果有帮助的话,这是我们目前尝试实现的示例代码(**之间的部分是我想要逐行预览的表格):

XIRR Test1 =

    CALCULATE (
        XIRR (
            **UNION(
                FILTER(
                    FILTER(
                    SELECTCOLUMNS(
                        'TestTransactions',
                        "Date",  RELATED('Dim Date'[DateValue]),
                        "Amount", 'TestTransactions'[TransactionAmount]
                    ),[TestFilter] <> 1),[Date] < MAX('Snapshot Table'[As Of Date])),
                     FILTER(
                        FILTER(
                        SELECTCOLUMNS(
                            'TestTransactions',
                            "Date",    RELATED('Dim Date'[DateValue]),
                            "Amount", 'TestTransactions'[TransactionAmount]
                        ), [TestFilter] = 1),[Date] =  MAX('Snapshot Table'[As Of Date]))
                    ),[Amount],[Date]))

我尝试在PowerBI报告中创建一个不同的页面,并将TestTransactions表格过滤到我期望的数据,但是从该数据中得到的XIRR与第一页上的数据不匹配,所以要么作为参数传递给XIRR的表格不是我所想的,要么XIRR还有其他的问题。

英文:

We've been trying to use the XIRR function in PowerBI, and trying all sorts of things over the better course of a month to get it to work. And we did, finally, get the XIRR function to stop erroring out. And it returns IRRs that seem reasonable enough for our test data for some IDs, but others look way too high.

I'm not looking for help with the XIRR function itself. As the first parameter of XIRR is a table, I'm wondering if there's a way to preview the Calculated Table that PowerBI will assemble using DAX and unions, so I can see what the raw data is passed into the XIRR DAX function.

As I said, I'm not looking for help on XIRR, but if it helps in any way, here's sample code for what we're trying to implement so far (parts between ** form the table I want to preview, line by line):

XIRR Test1 =

    CALCULATE (
        XIRR (
            **UNION(
                FILTER(
                    FILTER(
                    SELECTCOLUMNS(
                        &#39;TestTransactions&#39;,
                        &quot;Date&quot;,  RELATED(&#39;Dim Date&#39;[DateValue]),
                        &quot;Amount&quot;, &#39;TestTransactions&#39;[TransactionAmount]
                    ),[TestFilter] &lt;&gt; 1),[Date] &lt; MAX(&#39;Snapshot Table&#39;[As Of Date])),
                     FILTER(
                        FILTER(
                        SELECTCOLUMNS(
                            &#39;TestTransactions&#39;,
                            &quot;Date&quot;,    RELATED(&#39;Dim Date&#39;[DateValue]),
                            &quot;Amount&quot;, &#39;TestTransactions&#39;[TransactionAmount]
                        ), [TestFilter] = 1),[Date] =  MAX(&#39;Snapshot Table&#39;[As Of Date]))
                    )**,[Amount],[Date]))

I've tried just creating a different page in the PowerBI report and filtering the TestTransactions table down to what I'd expect it to be bringing in, but the XIRRs from that data does not match what's on the first page, so either the table being passed into XIRR as a parameter isn't as I thought, or there's more to XIRR.

答案1

得分: 1

你可以使用EvaluateAndLog()函数,并在调试器中查看输出结果,你可以在这里免费下载调试器:https://pbidax.wordpress.com/2022/08/16/introduce-the-dax-evaluateandlog-function/

如果你想要一个付费的调试器,那么Tabular Editor 3可以满足你的需求。

https://tabulareditor.com/

英文:

You can use EvaluateAndLog() function and see the output in a debugger which you can download for free here: https://pbidax.wordpress.com/2022/08/16/introduce-the-dax-evaluateandlog-function/

If you want a paid debugger, then Tabular Editor 3 will do what you want.

https://tabulareditor.com/

huangapple
  • 本文由 发表于 2023年8月9日 02:33:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76862315.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定