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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
joshua1990
Post Prodigy
Post Prodigy

Calculated Column Count same table multiple filters

Hi experts!

I have a table that shows me the status per sales order for specific regions:

Sales OrderRegionStatus
100ADBZ
101ADBZ
100ADBX
101ADBX
102PRIO

 

Now I would like to create a calculated column that shows me per Sales Order if there is an entry for a Sales Order and Region combination with the value 'X'. If so, all rows with this combination should get TRUE, otherwise FALSE.

How is this possible?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @joshua1990 
Please use the following

1.png

 

Flag = 
NOT ISEMPTY (
    CALCULATETABLE ( 
        Sales, 
        ALLEXCEPT ( Sales, Sales[Sales Order], Sales[Region] ),
        Sales[Status] = "X" 
    )
)

 

View solution in original post

3 REPLIES 3
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.

It is for creating a new column.

 

Untitled.png

 

Condition CC = 
VAR _currentsalesorder = Data[Sales Order]
VAR _currentregion = Data[Region]
VAR _newtablecondition =
    "X"
        IN SUMMARIZE (
            FILTER (
                Data,
                Data[Sales Order] = _currentsalesorder
                    && Data[Region] = _currentregion
            ),
            Data[Status]
        )
RETURN
    DIVIDE ( _newtablecondition, _newtablecondition ) + 0

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.


Go to My LinkedIn Page


tamerj1
Super User
Super User

Hi @joshua1990 
Please use the following

1.png

 

Flag = 
NOT ISEMPTY (
    CALCULATETABLE ( 
        Sales, 
        ALLEXCEPT ( Sales, Sales[Sales Order], Sales[Region] ),
        Sales[Status] = "X" 
    )
)

 

rodrigosan
Resolver III
Resolver III

Would it be this?

rodrigosan_0-1657479866916.png

 

Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors