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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Summarize and filter in two tables

Hello everyone

I have the following formula:

  VAR _Table = SUMMARIZE( 
	'Fact APO', [L8 SKU],
	"_FTBPEU", SUM('Fact APO'[FTBP EU])
    )

RETURN

COUNTROWS(
	FILTER(_Table, 	([_FTBPEU] <> 0) 
 ))

I want to add a filte to it. The filter is

DimL8[Status]= "ZD"

The two tables are connected by the SKU field

Done APO[L8 SKU] (many) ------ DimL8[SKU] (one)

But I can't seem to make this filter work. The purpose of the formula is to show the number of SKUs in the ZD state where the forecast (FTBP) is not zero. The reason is that we shouldn't have SKUs in ZD with forecast, so this formula will act as a kind of alert and a measure of how clean our forecast is.

The Fact APO table should be summarized because there are SKUs with multiple rows, for example, where they go to more than one customer. I want a different count regardless of how many customers

Thank you

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You could add the dimension condition as a filter when building your summary _Table.

VAR _Table =
    ADDCOLUMNS (
        SUMMARIZE ( 'Fact APO', 'Fact APO'[L8 SKU] ),
        "_FTBPEU",
            CALCULATE (
                SUM ( 'Fact APO'[FTBP EU] ),
                DimL8[Status] = "ZD"
            )
    )
RETURN
    COUNTROWS (
        FILTER ( _Table, [_FTBPEU] <> 0 )
    )

 

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

You could add the dimension condition as a filter when building your summary _Table.

VAR _Table =
    ADDCOLUMNS (
        SUMMARIZE ( 'Fact APO', 'Fact APO'[L8 SKU] ),
        "_FTBPEU",
            CALCULATE (
                SUM ( 'Fact APO'[FTBP EU] ),
                DimL8[Status] = "ZD"
            )
    )
RETURN
    COUNTROWS (
        FILTER ( _Table, [_FTBPEU] <> 0 )
    )

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.