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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Chanleakna123
Post Prodigy
Post Prodigy

Add another Condition

1.PNG

 

Hi All, 

* I have 2 tables , Table 1 is : Code , and table 2 as table above 

I linked the relationship between these 2 tables. 

 

i have condition as calculated as per above , and i set " Normal , Expired , High Risk as per above " , But i wanna add another "OOS" mean if the Code in Table 2 didn't appear  , it will show "OOS " while i use the Table 1 as the main , and visualize the condition in Table 2.  Because the Code in table 2 didn't appear , mean there's no QTY. 

 

how to success this ? 

 

I experienced with multiples condtion , but failed to get this . 

 

thanksyou 

 

 

6 REPLIES 6
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Chanleakna123

 

You may check below measure.

Condition Risk =
IF (
    'Master Data'[Expired in (Days)] > RELATED ( DOI[High Stock ] )
        && 'Master Data'[Code] = RELATED ( DOI[Code] ),
    "Normal",
    IF (
        'Master Data'[Expired in (Days)] <= RELATED ( DOI[HIGH Risk ] )
            && 'Master Data'[Code] = RELATED ( DOI[Code] ),
        "High Risk",
        IF (
            'Master Data'[Expired in (Days)] > RELATED ( DOI[POS Risk] )
                && 'Master Data'[Expired in (Days)] <= RELATED ( DOI[High Stock ] ),
            "Potential Expired",
            IF ( 'Master Data'[Code] <> RELATED ( DOI[Code] ), "OOS" )
        )
    )
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1.PNG2.PNG

 

Hi @v-cherch-msft Really Appreciated all your input . but look like it's in contrast of what i'm thinking . 

 

DoI Code table in Bi , is the main code we used , 

Master Data Code in BI is the table we key in the Data . 

My purpose is , If Master Data [Code] no Any recorded of the Code as the Main Table DoI[Code] Provided, Show" OOS ". 

Because my users will no key in Any data in there're no Quantity. then i will no , oh this Code is OOS. 

i test your calculation , look not correct . above 2483 has 45 cases in Master [ Code ] , but show OOS. 
if 2483 has 0 cases in Master Data [ Code ] which is no recorded should show OOS. 

 

thanks you , looking more your comment. 

 

Best Regards, 
Leakna 

@v-cherch-msft hi dear , 

 

any update on this ? 

Thanks you 

Hi @Chanleakna123

 

 

Based on my understanding, the "OOS" should be in DOI Table as below, right? Why it should be condition in the Master Table. I'm confused.

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Chanleakna123

 

It seems you need compare code column with table1 and table2. Is that right? If it is not your case, please share your data sample file and explain more about your expected output. You can upload it to OneDrive or Dropbox and post the link here.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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