我正在尝试将一张表格报告复制到power bi中。我是Tableau和Power BI的新手,因此我只是从在线学习并从事该项目。因此,在添加过滤器和分组列方面我没有几个问题。
在tableau中使用了一个自定义查询来生成报告。我在Power Bi中使用相同的报告来复制相同的报告。我已经附上了下面的代码。我已将查询加载到Power Bi中并可视化数据。但我想添加过滤器,就像tableau报告一样。但我不确定如何在Power BI中添加它们。 问题1:如何以与在Tableau中使用的相同的方式将过滤器添加到Power Bi(附有屏幕截图)问题2:在Tableau过滤器中,报告日期用于一个条件(报告date> = adddate和reportdate< = dropdate。您能帮助我如何在Power Bi中创建相同类型的过滤器吗? 3.如何以与Tableau相同的方式对Power Bi中的列进行分组?(附有屏幕截图)
解决方案
很好,您正在尝试到赢得Power BI和tableau,这两个非常棒的工具!我不会通过精确回答您的问题来破坏您的学习,但是我可以为您提供一些指导。
第二,您创建一个度量,该度量将确定表中的行是否与您所符合的条件相符指定。这是一种度量,因为计算的列不接受可变参数。
Included = var _selectedDate = SELECTEDVALUE (Parameter [Date]; MIN(Parameter [Date])) RETURN SUMX( Investments; IF( AND(Table [adddate ]< = _selectedDate;表[dropdate]> = _selectedDate); 1 ; 0 ))将度量添加到矩阵的可视过滤器中,并确保其过滤为值1。
最后,将Parameter [Date]字段添加到报表页面,并将其设置为可视样式切片器,如下所示:在问题1的答案中提到
I am trying to replicate one of the tableau report into power bi. I am new to tableau and power BI so I am just learning from online and working on this project. Hence I have few questions in adding filters and grouping columns.
there is a custom query used in tableau to build the report. I am using the same report in power bi to replicate the same report. I have attached the code below. I have loaded the query in power bi and visualize the data. but I wanted to add the filters same like the tableau report has. but I am unsure how to add those in power BI. Questions 1 : how do I add the filters to the power bi in a same way it is used in tableau(screenshots attached) questions 2: in tableau filter "report date" is used a condition (report date >=adddate and reportdate<=dropdate. could you please help me how to create the same type of filter in power bi? 3. how do I group by the columns in power bi in the same way as tableau does?(screenshot attached)
解决方案Good you are trying to learn Power BI and tableau, two really great tools! I'm not going spoil your learning by precisely answering your questions, but I can give you some directions.
Parameter = CALENDAR( MIN ( Table[adddate] ) ; MAX ( Table[dropdate] ) )
Secondly, you create a measure which will determine if a row in your table matches the criteria you specified. This needs to be a measure, as calculated columns do not accept variable parameters.
Included = var _selectedDate = SELECTEDVALUE( Parameter[Date] ; MIN ( Parameter[Date] ) ) RETURN SUMX ( Investments ; IF ( AND ( Table[adddate] <= _selectedDate ; Table[dropdate] >= _selectedDate ) ; 1 ; 0 ) )Add the measure to the visual filters of your matrix and make sure it filters for the value 1.
Finally, add the Parameter[Date] field to your report page and set it to the visual style slicer as mentioned in the answer to question 1
更多推荐
将Tableau报告复制到Power BI
发布评论