如何根据事实表限制切片器中的可用值数量?

时间:2018-03-19 16:05:50

标签: powerbi dax powerbi-embedded

我的Overall_Results表格中有ProducerGUID列。它包含大约146个唯一ProducerGUID

表格Producer(包含1,300个唯一ProducerGUID)与Overall_Results通过ProducerGUID加入。

enter image description here

使用切片器' ProducerName'它显示了所有1300个不同的生产者。

是否可以限制切片器中唯一生成器的数量并仅显示表'Overall_results'具有的那些?其中大约146个而不是1,300个?

enter image description here

1 个答案:

答案 0 :(得分:1)

我要尝试的第一件事是让CREATE TABLE tblCustomer ( CustomerID int, ... CONSTRAINT PK_tblCustomer PRIMARY KEY CLUSTERED (CustomerID) ) GO CREATE TABLE tblFilms ( FilmID int, ... CONSTRAINT PK_tblFilms PRIMARY KEY CLUSTERED (FilmID), ) GO CREATE TABLE tblCinemaScreens ( CinemaScreenID int, ... CONSTRAINT PK_tblCinemaScreens PRIMARY KEY CLUSTERED (CinemaScreenID) ) GO CREATE TABLE tblCinemaScreenFilms ( CinemaScreenFilmID int, CinemaScreenID int, FilmID int CONSTRAINT PK_tblCinemaScreenFilms PRIMARY KEY CLUSTERED (CinemaScreenFilmID), CONSTRAINT FK_FilmID FOREIGN KEY (FilmID) REFERENCES tblFilms(FilmID), CONSTRAINT FK_CinemaScreenID FOREIGN KEY (FilmID) REFERENCES tblCinemaScreens(CinemaScreenID) ) GO CREATE TABLE tblBookings ( BookingID int, CustomerID int, CinemaScreenFilmID int, ... CONSTRAINT PK_tblBookings PRIMARY KEY CLUSTERED (BookingID), CONSTRAINT FK_CustomerID FOREIGN KEY (CustomerID) REFERENCES tblCustomer(CustomerID), CONSTRAINT FK_CinemaScreenFilmID FOREIGN KEY (CinemaScreenFilmID) REFERENCES tblCinemaScreenFilms(CinemaScreenFilmID) ) GO Overall_Results之间的关系在两个方向上进行交叉过滤。

如果这不起作用,您还可以尝试在查询编辑器中执行内部联接,以便仅显示匹配的ID值。