Power BI:无日期列和ID列运行总计

发布于 2025-01-23 16:05:08 字数 391 浏览 5 评论 0原文

我只有一个只有2列的表格,即位置和评估次数,我想找到评估总数的运行总数。

在图像

位置评估
CA118,54
MT33
在DAX数据中
A23
CH17
RM2

I have a table with just 2 columns i.e Location and Number of assessments and I want to find the Running total for the total number of assessments.

In the Image Number of Assessments By Location , you can see that the running total (247) is appearing but with every Location. I just want a single bar at the end displaying 247 (not 741). I have used the SUM function on the Assessment in DAX

DATA :

LocationAssessments
CA118
AT54
MT33
AN23
CH17
RM2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

那些过往 2025-01-30 16:05:09

为了实现所需的目标,您需要一个派生的表格数据集,其中包含所有位置的“总计”。

您可以创建这样的派生表,

Table =
VAR _tbl =
    UNION ( //step3-appending subTbl1 to subTbl2
        ADDCOLUMNS (
            DATATABLE ( "Local", STRING, { { "Total" } } ), //step1- creating a table that contains the total of all the locations --subTbl1
            "Value", SUMX ( t1, t1[Assessments] )
        ),
        SELECTCOLUMNS (
            t1,
            "Local", t1[Location],
            "Value", CALCULATE ( SUM ( t1[Assessments] ) ) //step2-creating a table that contains the total of all the locations by location -- subTbl2
        )
    )
RETURN
    _tbl

一旦拥有,就可以绘制这样的数据点

“

In order for you to achieve what you need, You need a derived tabular dataset which contains "Total" of all the Location.

You can create a derived table like this

Table =
VAR _tbl =
    UNION ( //step3-appending subTbl1 to subTbl2
        ADDCOLUMNS (
            DATATABLE ( "Local", STRING, { { "Total" } } ), //step1- creating a table that contains the total of all the locations --subTbl1
            "Value", SUMX ( t1, t1[Assessments] )
        ),
        SELECTCOLUMNS (
            t1,
            "Local", t1[Location],
            "Value", CALCULATE ( SUM ( t1[Assessments] ) ) //step2-creating a table that contains the total of all the locations by location -- subTbl2
        )
    )
RETURN
    _tbl

Once you have that, you can plot the data points like this
s1

s2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文