小炭猪

一夕一绽一缕芳,一生一叹一痕沙

0%

PowerBI常见操作

分析方法

按周进行数据分析

Source:https://zhuanlan.zhihu.com/p/58948031

按条件统计数量(DAX)

增加一个统计列,此列统计了符合FILTER条件的数据数量:

1
不足8小时数量 = COUNTROWS(FILTER(sheet1, sheet1[Group] = "招聘管理" && sheet1[出勤时长]<7.5 && sheet1[出勤时长] > 0 || sheet1[Group] <> "招聘管理" && sheet1[出勤时长] < 8 &&  sheet1[出勤时长] > 0))

类Excel的计算

VLOOKUP (DAX)

Document: https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax
Example: https://www.wallstreetmojo.com/vlookup-in-power-bi/

Syntax

1
2
3
4
5
6
7
LOOKUPVALUE(
<result_columnName>,
<search_columnName>,
<search_value>
[, <search2_columnName>, <search2_value>]…
[, <alternateResult>]
)

Parameters

Term Definition
result_columnName The name of an existing column that contains the value you want to return. It cannot be an expression.
search_columnName The name of an existing column. It can be in the same table as result_columnName or in a related table. It cannot be an expression.
search_value The value to search for in search_columnName.
alternateResult (Optional) The value returned when the context for result_columnName has been filtered down to zero or more than one distinct value. When not provided, the function returns BLANK when result_columnName is filtered down to zero value or an error when more than one distinct value.

Return value

The value of result_column at the row where all pairs of search_column and search_value have an exact match.

If there’s no match that satisfies all the search values, BLANK or alternateResult (if supplied) is returned. In other words, the function won’t return a lookup value if only some of the criteria match.

If multiple rows match the search values and in all cases result_column values are identical, then that value is returned. However, if result_column returns different values, an error or alternateResult (if supplied) is returned.



转载请注明出处:PowerBI常见操作
原文地址:https://www.xiaotanzhu.com/powerbi/powerbi-howtos.html