2
votes

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)enter image description here

enter image description here

enter image description here

1

1 Answers

3
votes

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.

enter image description here enter image description here

  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] ) )

enter image description here

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.

enter image description here

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.

enter image description here enter image description here