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
united2win
Helper III
Helper III

Help with DAX?

Hi,

I have the following table, looking to create a column with a DAX formula that identies if a Seller has a German Registration. Can anoyne provide that formula pls? I was hoping it would be simple, but having difficulty. 

 

SellerCountryDAX Column
Seller AGermanyYes
Seller BItaly 
Seller AFranceYes
Seller AItalyYes
Seller CGermanyYes
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @united2win ,

 

According to this——For example if a Seller has both Italy and Germany, the Italian address is blank. How do I change the formula to include yes for both lines?

 

So for seller A , it has three countries,  including Germany, so the three lines for seller A are all "Yes".

I think @selimovd 's method works fine, it acheive the same output as your expected.

 

Below is my workaround and output.

Column = 
var _t= SUMMARIZE(FILTER('Table',[Seller]=EARLIER('Table'[Seller])),[Country])
return IF("Germany" in _t,"Yes")

Eyelyn9_0-1653378046231.png

 

If I'm misunderstanding, please share more details to help us clarify your scenario.

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @united2win ,

 

According to this——For example if a Seller has both Italy and Germany, the Italian address is blank. How do I change the formula to include yes for both lines?

 

So for seller A , it has three countries,  including Germany, so the three lines for seller A are all "Yes".

I think @selimovd 's method works fine, it acheive the same output as your expected.

 

Below is my workaround and output.

Column = 
var _t= SUMMARIZE(FILTER('Table',[Seller]=EARLIER('Table'[Seller])),[Country])
return IF("Germany" in _t,"Yes")

Eyelyn9_0-1653378046231.png

 

If I'm misunderstanding, please share more details to help us clarify your scenario.

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

selimovd
Super User
Super User

Hey @united2win ,

 

you can add a new calculated column and check if the seller in the current row has another row with country Germany.

The following measure should do that:

Has German Adress = 
VAR vSellerCurrentRow = SellerTable[Seller]
RETURN
    IF (
        CALCULATE (
            COUNTROWS ( SellerTable ),
            SellerTable[Seller] = vSellerCurrentRow,
            SellerTable[Country] = "Germany"
        ) > 0,
        "Yes",
        BLANK ()
    )

 

The result looks then like that:

selimovd_0-1652967797700.png

 

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

Hi, 

 

Can anyone help with the below? Thank you.

 

 

Thanks Dennis, I've inputted the formula, but it's only returning "Yes" for the German addresses. For example if a Seller has both Italy and Germany, the Italian address is blank. How do I change the formula to include yes for both lines?

united2win_0-1652968488879.png

 

Hey @united2win ,

 

when you reply, please make sure to mark the person with the the @ symbol like this: @united2win .

Otherwise I will not be notified that you replied and then I cannot help you.

 

If you want to check if the Seller has an Italian or German address, then try that one:

Has German Adress = 
VAR vSellerCurrentRow = SellerTable[Seller]
RETURN
    IF (
        CALCULATE (
            COUNTROWS ( SellerTable ),
            SellerTable[Seller] = vSellerCurrentRow,
            SellerTable[Country] = "Germany" || SellerTable[Country] = "Italy"
        ) > 0,
        "Yes",
        BLANK ()
    )

 

Otherwise you have to be a little bit more specific with your requirements. My solution was doing exactly what you asked for.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

 

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.