Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Martz86
Regular Visitor

Subcategory Based on filtered values - Matrix Table

Hi,

I want to create a slicer for products without forecast for current month. Table is similar to below and I have a slicer that I use to select the month I'm looking at. Say I want data for just July (click the July slicer button). Goal would be to have a button or put in the field that is No Forecast w actuals or Forecasted. 

 

Prod 

ForecastActuals
Product 1 100
Product 25025

 

I've created a new column in data model but it does have relationship to my period slicer in using.

 

Thanks,
Dean

2 ACCEPTED SOLUTIONS
anilgavhane
Responsive Resident
Responsive Resident

Ensure Relationships Are Set

  • Your Forecast/Actuals table should be linked to a Date table via a date field (e.g., Month).
  • Your slicer should be based on the Date table (e.g., DateTable[Month]).

2. Create a Classification Column

In Power BI, create a calculated column like this:

 

ProductStatus = VAR SelectedMonth = MAX('DateTable'[Month]) VAR ForecastValue = LOOKUPVALUE(FactTable[Forecast], FactTable[Month], SelectedMonth, FactTable[Product], FactTable[Product]) VAR ActualValue = LOOKUPVALUE(FactTable[Actuals], FactTable[Month], SelectedMonth, FactTable[Product], FactTable[Product]) RETURN SWITCH( TRUE(), ISBLANK(ForecastValue) && NOT(ISBLANK(ActualValue)), "No Forecast w Actuals", NOT(ISBLANK(ForecastValue)), "Forecasted", "Other" )

 

 

 

Replace FactTable with your actual table name.

 

This column will classify each product based on the selected month.

 

3. Use the Classification in a Slicer

  • Add ProductStatus to a slicer.
  • Now users can filter by “No Forecast w Actuals” or “Forecasted”.

 

4. Matrix Visual Setup

  • Rows: Product
  • Columns: Month (from Date table)
  • Values: Forecast, Actuals
  • Apply slicers for Month and ProductStatus

View solution in original post

Hi @Martz86,
Thank you for the Follow-up Question.

You have understood it correctly. The approach uses two helper measures (Has Actuals and Has Forecast) along with a disconnected table that acts as the slicer. Let me break it down step by step so you can replicate it in your own report.

Create helper measures that simply check if a product has values for Actuals or Forecast both are different measures: 

Has Actuals =
IF ( NOT ISBLANK ( SUM ( Data[Actuals] ) ), 1, 0 )
Has Forecast =
IF ( NOT ISBLANK ( SUM ( Data[Forecast] ) ), 1, 0 )

Create a disconnected slicer table that gives users a choice:

SlicerTable =
DATATABLE ( "Option", STRING, { {"Forecasted"}, {"No Forecast w Actuals"} } )

Add this table to your model without creating relationships.

Create a filter measure that applies the slicer selection:

Show Filtered Data =
SWITCH (
SELECTEDVALUE ( SlicerTable[Option] ),
"Forecasted", [Has Forecast],
"No Forecast w Actuals", [Has Actuals]
1. )


Apply the filter measure by placing Show Filtered Data in the Visual-level filter of your table/matrix and setting it to “is 1”.
This way, when a user toggles the slicer, the visual will only show rows that match the chosen condition. 


If you would like, feel free to share a small sample dataset with your expected outcome I can then help tailor the DAX more closely to your exact model.

Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

View solution in original post

6 REPLIES 6
anilgavhane
Responsive Resident
Responsive Resident

Ensure Relationships Are Set

  • Your Forecast/Actuals table should be linked to a Date table via a date field (e.g., Month).
  • Your slicer should be based on the Date table (e.g., DateTable[Month]).

2. Create a Classification Column

In Power BI, create a calculated column like this:

 

ProductStatus = VAR SelectedMonth = MAX('DateTable'[Month]) VAR ForecastValue = LOOKUPVALUE(FactTable[Forecast], FactTable[Month], SelectedMonth, FactTable[Product], FactTable[Product]) VAR ActualValue = LOOKUPVALUE(FactTable[Actuals], FactTable[Month], SelectedMonth, FactTable[Product], FactTable[Product]) RETURN SWITCH( TRUE(), ISBLANK(ForecastValue) && NOT(ISBLANK(ActualValue)), "No Forecast w Actuals", NOT(ISBLANK(ForecastValue)), "Forecasted", "Other" )

 

 

 

Replace FactTable with your actual table name.

 

This column will classify each product based on the selected month.

 

3. Use the Classification in a Slicer

  • Add ProductStatus to a slicer.
  • Now users can filter by “No Forecast w Actuals” or “Forecasted”.

 

4. Matrix Visual Setup

  • Rows: Product
  • Columns: Month (from Date table)
  • Values: Forecast, Actuals
  • Apply slicers for Month and ProductStatus

v-kpoloju-msft
Community Support
Community Support

Hi @Martz86,

Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to @lbendlin, for his inputs on this thread. I reproduced the scenario, and it worked on my end. I used my sample data and successfully implemented it.

vkpolojumsft_0-1758003320312.png

I am also including .pbix file for your better understanding, please have a look into it.

Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

Hi @v-kpoloju-msft 

 

This is great however can you please explain how this was accomplished? You created two measures "Has Actuals" & "Has Forecast". Then created a table to be used as a slicer which toggles between the conditions? Is this correct? I'm trying to understand the measures required and relationships needed to implement on my report.

 

Thanks,
Dean

Hi @Martz86,
Thank you for the Follow-up Question.

You have understood it correctly. The approach uses two helper measures (Has Actuals and Has Forecast) along with a disconnected table that acts as the slicer. Let me break it down step by step so you can replicate it in your own report.

Create helper measures that simply check if a product has values for Actuals or Forecast both are different measures: 

Has Actuals =
IF ( NOT ISBLANK ( SUM ( Data[Actuals] ) ), 1, 0 )
Has Forecast =
IF ( NOT ISBLANK ( SUM ( Data[Forecast] ) ), 1, 0 )

Create a disconnected slicer table that gives users a choice:

SlicerTable =
DATATABLE ( "Option", STRING, { {"Forecasted"}, {"No Forecast w Actuals"} } )

Add this table to your model without creating relationships.

Create a filter measure that applies the slicer selection:

Show Filtered Data =
SWITCH (
SELECTEDVALUE ( SlicerTable[Option] ),
"Forecasted", [Has Forecast],
"No Forecast w Actuals", [Has Actuals]
1. )


Apply the filter measure by placing Show Filtered Data in the Visual-level filter of your table/matrix and setting it to “is 1”.
This way, when a user toggles the slicer, the visual will only show rows that match the chosen condition. 


If you would like, feel free to share a small sample dataset with your expected outcome I can then help tailor the DAX more closely to your exact model.

Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

Hi @v-kpoloju-msft ,

 

Thank you so much! This helps tremendously to simplfy the report! I was using bookmarks but that was a bit wonky and managing that many users was not feasible. This works amazing!!

 

Thanks,

Dean

lbendlin
Super User
Super User

Use the Filter Pane.  Teach your users how to exclude "(Blank)"  values in the "Forecast"  column.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.