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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
united2win
Helper III
Helper III

Countrows DAX help

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

I just added the country as so:

NickolajJessen_0-1653040174473.png

Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! ☺

 

View solution in original post

12 REPLIES 12
Tahreem24
Super User
Super User

@united2win You can try this Measure:

Measure = If(COUNTROWS(FILTER(TableSeller,TableSeller[Country]="Germany"))>0,"Yes","No")
Capture.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Same issue as below, the first row in your table should return "Yes" as Seller A has a jurisdiction in Germany. 

NickolajJessen
Solution Sage
Solution Sage

Does this work?

NickolajJessen_0-1653039221303.png

 

Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

Still only returns on the German jurisdiction. I'm looking to see if a Seller has a DE jurisdiction and then extrapoloate that across the other jurisdictions. Like below: 

 

SellerCountryCalculated DAX Column
ADEYes
AITYes
BDEYes
AFRYes
CFR 

I just added the country as so:

NickolajJessen_0-1653040174473.png

Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! ☺

 

This is exactly what I'm looking for, did you create this as a measure or new column? I've copied the DAX into a new column, but still getting "Yes" only for Germany 😞

Anonymous
Not applicable

A measure 😊

And would it be possible to get the same as a calculated column?

Yes, neat trick is to just wrap the measure in a calculate 

NickolajJessen_0-1653043238022.png

nb. countrows being the measure we created above.

Also it would have been better to know, that a calculated column was needed, when i asked in message 2. 😅

Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

 

Still only returning German addresses unfortunatley. Sorry, I thought I already mentioned that, thanks for your help on this...Very muc appreciated. 

 

Also copied the measure.

united2win_1-1653044084747.png

 

 

united2win_0-1653044035487.png

 

NickolajJessen
Solution Sage
Solution Sage

I feel like this post was also here yesterday..

Specify what you already tried. Specify what suggestions were made yesterday that didn't work.

Are you looking to do it in a measure or a calculated column? Do you have acces to edit the data in power Query?

Hi,

Below was already tried, and like mentioned on the other post, it's only returning "Yes" for the German jurisdictions. I'm trying to create a calculated column and yes I have access to power query. 

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

 

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors