Forum Discussion
sirbaklava
2 years agoRegular Visitor
Comparing Data Across Two Filters in Power BI
Hello Power BI Community, I'm working on a project where I need to compare data across two different filters at a time. My dataset includes two key columns: Site and Item Name. The goal is to cre...
- 2 years ago
How about this table?
I also set the filter.
When using the 'SELECTEDVALUE' function, I think the data column you set for the slicer should be different from the base data column.
mickey64
2 years agoSuper User
For youre reference.
Step 0: I use your data below.
Step 1: I make 2 tables below.
- 'Sel_Item' Table -
- 'Sel_Site' Table -
Step 2: I make 2 slicers, 2 cards, 2 mesures and a table.
IsInBaselineSite =
VAR SelectedBaselineSite = SELECTEDVALUE('Sel_Site'[Site])
VAR CurrentItem = SELECTEDVALUE('Sel_Item'[Item])
RETURN
IF(
COUNTROWS(
FILTER(
ALL(sample_data),
sample_data[site] = SelectedBaselineSite &&
sample_data[item] = CurrentItem
)
) > 0,
"Yes",
"No"
)
IsInComparisonSite =
VAR SelectedComparisonSite = SELECTEDVALUE('Sel_Site'[Site])
VAR CurrentItem = SELECTEDVALUE('Sel_Item'[Item])
RETURN
IF(
COUNTROWS(
FILTER(
ALL(sample_data),
sample_data[site] = SelectedComparisonSite &&
sample_data[item] = CurrentItem
)
) > 0,
"Yes",
"No"
)
- 'Site' Slicer-
- 'Item' Slicer -
- Card 1 -
- Card 2 -
- Table -
sirbaklava
2 years agoRegular Visitor
I would provide a PBIX file and sample data of my own but I'm not able to do on here.