replicating the tableau report into power BI

女生的网名这么多〃 提交于 2019-12-01 08:33:02

问题


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)


回答1:


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.

  1. Try using the slicer visual and in the visual select drop-down.

  1. This one is a bit more complicated in Power BI as it requires you to create multiple objects. First you should create a list of values for your parameter. You can do this using Create New Table and using the CALENDAR() function, it's called a calendar table. Combine it with a MIN() and MAX() function to get the first and last dates in your dataset.
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

  1. Try the matrix visualization and make sure that you drill down in the visual. Hover your mouse over it and select the branched arrow.



来源:https://stackoverflow.com/questions/57461892/replicating-the-tableau-report-into-power-bi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!