0
votes

I have a table with different values that I want to use in Power BI. What I want to do is to use the date slicer to filter the results given without changing my text column.

As you can see in my screenshot, I have a bunch of columns, a slicer, and a Team Name. I want to change the period, and the values from the columns have to change accordingly but to the keep the Team Name column intact (where there are no values there it should return 0).

Thank you!

screenshot

1

1 Answers

0
votes

You will need two things to accomplish this, a one-to-many relationship and a measure that converts blank values into zeros.

First, you need to split your source into two tables, and set a one-to-many relationship between the two tables. For example, create a table of teams:

Power BI table of teams

And a table with the rest of the columns including the slicer column (Count users, Active users, Count of deleted users, Date, etc.)

Power BI table of team details

Then set a one-to-many relationship between the two tables:

Power BI table relationship dialog

Second, you will need a measure (or multiple measures) that replaces Blank values with zeros. For example, in your first table, create the following measure:

Count Measure = IF(ISBLANK(SUM(Table3[User Count])), 0, SUM(Table3[User Count]))

The result is all the teams, even those without any matching row in the second table:

Power BI table filtered by a date slicer