powerbi

DAX expression for COUNT of GROUPBY

半腔热情 提交于 2020-01-23 09:51:10
问题 I am new to PowerBI and writing DAX expressions. I have a table with a text column with different values.All I want to do is get the count for each distinct value. It's easily achieved with this SQL but I can't get the right DAX expression for it. select [value],count(*) as TagCount from Tags group by [value] order by TagCount desc Any help? 回答1: You can do something similar in Power BI as follows: SUMMARIZE(Tags, Tags[value], "TagCount", COUNT(Tags[value])) or SUMMARIZECOLUMNS(Tags[value],

Power Query to Filter a SQL view based on an Excel column list

点点圈 提交于 2020-01-23 03:45:47
问题 Is there a way to filter a SQL view based on a list of values in an excel table column using Power Query? I have a SQL view that returns a large set of data (millions of records or properties). Users want to filter that based on an excel table column of property IDs. I know I can just do a merge join based on the property ID between the view and the excel column in power query. But it looks like the merge brings in the millions of records first then filtered it in the join. Which takes a long

DAX Calculate function with and without FILTER

守給你的承諾、 提交于 2020-01-21 01:37:47
问题 What is the difference in results of CALCULATE function if we use it with and without FILTER function. Suppose we have those two measures: Measure1 = CALCULATE([X], 'FactTable'[Color]="Red") Measure2 = CALCULATE([X], FILTER('FactTable', 'FactTable'[Color]="Red") Update. Additional bounty question: Is there a way to modify Measure2 by using other functions, such as ALL , or ALLSELECTED , so that it would return exactly the same results as Measure1 ? Update after bounty I have decided to grant

一步一步教你制作销售业绩分析报告

爷,独闯天下 提交于 2020-01-19 20:12:38
在入门案例动态销售报告中已经带领大家入门制作PowerBI可视化报告。本文主题销售业绩分析将继续针对入门案例进行进一步优化,让大家更改的了解和掌握使用PowerBI的功能。优化内容主要有两个:   1、数据分析层面:在可视化报告中单独的一个销售业绩指标是没有意义的,只有通过对比指标才能知道销售业绩指标的好坏。对比方法主要通过同指标不同时间的对比,通过PowerBI智能时间函数,可以更加方便的计算累计销售额(YTD),同比(与去年同期对比),环比(与上月对比)等指标。   2、图表层面:使用KPI图表可以更加直观的显示业绩完成状况。通过对同比,环比格式设置可以进行分阶段显示数据。   本文的数据源主要包含有销售明细数据,销售目标数据,以及日期数据源。   销售明细数据   销售目标数据   日期数据   一、创建日期表   日期表作为时间智能函数的基础表,PowerBI可以自动未具有日期或日期时间类型的字段自动创建一个隐藏的日期表。动手操作PowerBI的小伙伴们应该都已经发现了这个功能。软件自带的日期表开启方式如下图:(打开路径:文件=》选项和设置=》选项=》数据加载,默认已勾选自动日期/时间)   上图中的自动日期表并不能够很好的满足不同的业务场景需求,在模型复杂的情况下也会导致文件体积偏大,我们可以通过手动创建日期表。接下来我会教大家创建日期表的三种方式。   1

PowerBI笔记:字段不自动求和

ぐ巨炮叔叔 提交于 2020-01-19 00:02:55
数值字段不自动求和 原因一:字段数据类型为“本文”型 解决方案:直接在PowerBI中将该字段数据类型改为“整数” 原因二:存在建模关系 PowerBI自动将该字段与其他表建立了关系。 解决方案:删除关系。 来源: CSDN 作者: weixin_42389438 链接: https://blog.csdn.net/weixin_42389438/article/details/104027900

Calculate Total by specific column, then apply column total to each row

拜拜、爱过 提交于 2020-01-16 16:48:10
问题 I would like to apply the total count('case_id'), while grouping by the Item. This was my previous ask DAX Measure to calculate aggregate data, but group by Case ID. This gave me the total count('case_id') by sub_item. Measure = VAR datesSelection = DATE( YEAR(SELECTEDVALUE('Date Selection'[DateWoTime])) ,MONTH(SELECTEDVALUE('Date Selection'[DateWoTime])) ,DAY(SELECTEDVALUE('Date Selection'[DateWoTime])) ) VAR devicesTotal = CALCULATETABLE ( VALUES ( Outages[Sub_Item] ), ALLSELECTED ( Outages

How to calculate daily percentage over month on month volume?

旧街凉风 提交于 2020-01-16 16:13:13
问题 I am trying to sum the volume based on month and year for certain records in the given data and then for the given month I am trying to calculate the daily percentage arrival in power bi for the record Person A,1/1/2018,Project,100,1 it should be 100/220 Below is the example data: Resource Name,Month,RecordType,Actual,Flag Person A,1/1/2018,Project,100,1 Person A,1/2/2018,Support,40,1 Person A,1/3/2018,Training,50,1 Person A,1/4/2018,Unavailable,30,1 Person A,2/1/2018,Project,80,1 Person A,2

How to create dynamic ranking that would respond by date slicer in Power bi

北城余情 提交于 2020-01-16 08:05:12
问题 I simply need to create ranking column for each ClaimantID based on TransactionDate DESC. example .pbix file can be found here: https://www.dropbox.com/s/9dsnylng70t5a8i/Count%20Open%20and%20Closed%20at%20Point%20of%20time.pbix?dl=0 On a picture below I have two unique claims with TransactionDate. So how can I RANK ClaimantID by TransactionDate in descending order? I tried to create column Rank. But it does not give me desirable result: Rank = RANKX( CALCULATETABLE( Claimants ,ALLEXCEPT

Power query M the IN operator

流过昼夜 提交于 2020-01-15 09:41:30
问题 What would be equivalent of SQL IN operator for Power BI. Just like in clause: where [Column1] IN ('Value1', 'Value2', 'Value3') I am looking for M solution (not DAX). 回答1: You can use the List.Contains function. For example, = Table.SelectRows(Table1, each List.Contains({'Value1', 'Value2', 'Value3'}, [Column1])) will filter Table1 to include only rows where [Column1] is contained in the given list. 来源: https://stackoverflow.com/questions/51740679/power-query-m-the-in-operator

Sum distinct values for first occurance in Power BI

杀马特。学长 韩版系。学妹 提交于 2020-01-14 04:14:15
问题 In Power BI I have some duplicate entries in my data that only have 1 column that is different, this is a "details" column. Name | Value | Details Item 1 | 10 | Feature 1 Item 1 | 10 | Feature 2 Item 2 | 15 | Feature 1 Item 3 | 7 | Feature 1 Item 3 | 7 | Feature 2 Item 3 | 7 | Feature 3 I realize this is an issue with the data structure, but it cannot be changed. Basically, when I sum up my Value column on a Power BI card, I only want it to sum for each unique name, so in this case: Total =