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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
tarekeal
New Member

Calculated column with one filter selected and no filter

Hi, I have a table with date, salepersons, their location and their sales amount and a status column saying if they are internal or external.

DateSalespersonsLocationAmountStatus
12/1/2022JeanBrussels125Internal
12/1/2022AlexBrussels150External
13/1/2022BrunoParis130Internal


In a calculated table using SUMMARIZECOLUMNS I'm summarizing the sales by location and date but I'm struggling with the status since I would like to differentiate between internal and ALL (which is basically the sum of both), not between internal and external, such as hereunder.

DateLocationStatusAmount
12/1/2022BrusselsInternal125
12/1/2022BrusselsAll275
13/1/2022ParisInternal130
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Picture1.png

 

NewTable = 
VAR tablefilter =
SELECTCOLUMNS(
    FILTER (
        ADDCOLUMNS (
            Data,
            "@filter", IF ( Data[Status] = "Internal", "Internal", "All" )
        ),
        [@filter] = "Internal"
    ), "Date",  Data[Date], "Location", Data[Location], "@Status", [@filter], "@Amount", Data[Amount] )
VAR summarytable =

    SUMMARIZECOLUMNS (
        Data[Date],
        Data[Location],
        "@Status", IF("External" in VALUES(Data[Status]),"ALL", BLANK()),
        "@Amount", IF("External" in VALUES(Data[Status]), SUM ( Data[Amount] ), BLANK() )
    )
RETURN
UNION( tablefilter,
 summarytable )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1647840776592.png

 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Picture1.png

 

NewTable = 
VAR tablefilter =
SELECTCOLUMNS(
    FILTER (
        ADDCOLUMNS (
            Data,
            "@filter", IF ( Data[Status] = "Internal", "Internal", "All" )
        ),
        [@filter] = "Internal"
    ), "Date",  Data[Date], "Location", Data[Location], "@Status", [@filter], "@Amount", Data[Amount] )
VAR summarytable =

    SUMMARIZECOLUMNS (
        Data[Date],
        Data[Location],
        "@Status", IF("External" in VALUES(Data[Status]),"ALL", BLANK()),
        "@Amount", IF("External" in VALUES(Data[Status]), SUM ( Data[Amount] ), BLANK() )
    )
RETURN
UNION( tablefilter,
 summarytable )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thanks a lot, I ended up using SUMMARIZECOLUMNS twice since the first table was not giving the right values with the real data.

amitchandak
Super User
Super User

@tarekeal why there is no all by pairs?

One way is

Union(

Summarize(Table, Table[Date], Table[Location], Table[Status], "Amount", Sum(Table[Amount]) ) ,

Summarize(Table, Table[Date], Table[Location], Status, "All", "Amount", Sum(Table[Amount]) )

)

 

or

 

Union(

Summarize(Table, Table[Date], Table[Location], Table[Status], "Amount", Sum(Table[Amount]), "_cnt", countrows(Table) ) ,

filter( Summarize(Table, Table[Date], Table[Location], Status, "All", "Amount", Sum(Table[Amount]), "_cnt", countrows(Table) ), "_cnt" >1)

)

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Users online (4,796)