Power BI DAX

编程入门 行业动态 更新时间:2024-10-26 04:21:25
本文介绍了Power BI DAX - 具有过滤器的总列的百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我对 Power BI 比较陌生 - 在衡量指标中寻求占总数百分比"逻辑的帮助时,我一直在寻找高低的帮助,并且只找到了未应用过滤器且我需要在 DAX 代码中应用过滤器的示例.

I'm relatively new to Power BI - have looked high and low for help with "percent of total" logic in a measure and have found only examples where filters ARE NOT applied and I need to apply filters in the DAX code.

我想出了以下内容,这给了我所有的(100% 的值,而不是总数的百分比).我认为我需要对 ALLSELECTED 等做一些不同的事情,但可以使用你们任何人的任何想法.顺便说一句,我已经尝试过 SUM、SUMX、ALL、ALLEXCEPT、ALLSELECTED 等的所有组合.非常感谢您的指导.

I have come up with the following, which gives me all ones (100% values instead of the percentages of the total). I think I need to do something different with the ALLSELECTED, etc., but could use any thoughts that any of you have. BTW, I have tried every combination of SUM, SUMX, ALL, ALLEXCEPT, ALLSELECTED, etc. Many thanks in advance for your guidance.

Mix % = CALCULATE ( SUM ( service_line_analysis_unpivot[Value] ), service_line_analysis_unpivot[Attribute] = "netrevenue" ) / CALCULATE ( SUMX ( service_line_analysis_unpivot, service_line_analysis_unpivot[Value] ), FILTER ( service_line_analysis_unpivot, service_line_analysis_unpivot[Attribute] = "netrevenue" ), ALLSELECTED () )

推荐答案

如果您希望净收入除以切片器/过滤器选择中所有内容的总净收入,那么我认为这就是您想要的:

If you want net revenue divided by total net revenue for everything in your slicer/filter selection, then I think this is what you want:

Mix % = DIVIDE ( CALCULATE ( SUM ( service_line_analysis_unpivot[Value] ), service_line_analysis_unpivot[Attribute] = "netrevenue" ), CALCULATE ( SUM ( service_line_analysis_unpivot[Value] ), service_line_analysis_unpivot[Attribute] = "netrevenue", ALLSELECTED () ) )

如果这不正确,那么我们需要查看有关您的数据表、过滤器和视觉对象的更多详细信息.

If that's not right, then we'll need to see more detail on your data table, filters, and visuals.

更多推荐

Power BI DAX

本文发布于:2023-10-30 08:05:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542264.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Power   BI   DAX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!