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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply

Multiple filters with CALCULATE (COUNTROWS(FILTER (VALUES

I'm trying to find a way to show where I have SKUs with sales but no forecast and also SKUs with forecast but no sales, for any given product.  This way it alerts me if I have forecast on the wrong SKUs.   For example, where I am forecasting on SKU A but I am actually selling on SKU B.

 

I've broken it into steps: 

 

1: count number of SKUs with sales in last 3 months but no forecast

2. count numbers of SKUs with forecast in next 3 months but no sales

3. if both above steps are >0, display product in table

 

This is the formula I have started withn for step 1.  It shows SKUs with sales > 5 in last 5 months - but how do I add the filter to ensure it also excludes SKUs with forecast?

No. SKUs Sales = CALCULATE (
    COUNTROWS(
        FILTER (
            VALUES ( 'Fact APO'[L8 SKU] ),
            CALCULATE (
                SUM ( 'Fact APO'[Billed Sales EU] )
            ) > 5
        )
    ),
    DimDate[Rolling12] = "Last 3 Months"
)

 

The second formula shows SKUs with forecast >5 in next 3 months.  But how do I exclude thse which also have sales?

No. SKUs Fcst = CALCULATE (
    COUNTROWS(
        FILTER (
            VALUES ( 'Fact APO'[L8 SKU] ),
            CALCULATE (
                SUM ( 'Fact APO'[FTBP EU] )
            ) > 5
        )
    ),
    DimDate[Rolling12] = "Next 3 Months" 
)

 

Essentially, I'm having issues putting the two formulas together.

 

Thanks for the help

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@dapperscavenger Perhaps:

No SKUs Sales and Fcst =
  VAR __Table = SUMMARIZE('Fact APO',[L8 SKU],"__BilledSalesEU",SUM('Fact APO'[Billed Sales EU]),"__FTBPEU",SUM('Fact APO'[FTBP EU]))
RETURN
  COUNTROWS(FILTER(__Table,[__BilledSalesEU] > 5 && [__FTBPEU] > 5))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
v-xulin-mstf
Community Support
Community Support

Hi @dapperscavenger,

Can you provide your data structure and sample data?
That would make the issue clear.

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

Greg_Deckler
Community Champion
Community Champion

@dapperscavenger Perhaps:

No SKUs Sales and Fcst =
  VAR __Table = SUMMARIZE('Fact APO',[L8 SKU],"__BilledSalesEU",SUM('Fact APO'[Billed Sales EU]),"__FTBPEU",SUM('Fact APO'[FTBP EU]))
RETURN
  COUNTROWS(FILTER(__Table,[__BilledSalesEU] > 5 && [__FTBPEU] > 5))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you!  I was able to use a variation of this to get the outcome I needed 🙂

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.