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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
selpaqm
Helper V
Helper V

earlier function combine with other columns

Hi,

 

I have a table as below. 

Column uses 

"Column =
VAR _count= CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[salesman/country]=EARLIER('Table'[salesman/country])&&'Table'[Index]>=EARLIER('Table'[Index])))
VAR _count2=CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[salesman/country]=EARLIER('Table'[salesman/country])))
return if(_count=_count2,1,0)"

selpaqm_0-1599826044676.png

selpaqm_1-1599826068491.png

however, in case of method a and b is for same country and salesman need to be written as mixed.

as an example updated method column should be as below.

Capture.PNG

below you may find the related pbix file

example.pbix 

 

1 ACCEPTED SOLUTION

@selpaqm , refer this can work as a new column

Column =
VAR _count= CALCULATE(DistinctCount([Method]) ,FILTER('Table','Table'[salesman/country]=EARLIER('Table'[salesman/country])))+0
return if(_count>1,"Mixed", [method])

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

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@selpaqm First, DAX Formatter is your friend: https://www.daxformatter.com/

 

Column =
  VAR __Table = 
    SUMMARIZE(
        FILTER (
            'Table',
            'Table'[salesman/country] = EARLIER ( 'Table'[salesman/country] ),
            [method]
        )
RETURN
    IF ( COUNTROWS(__Table>1, "mixed", MAXX(__Table,[method]) )

If not, share data as text in a table please. 

  



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

hi @Greg_Deckler 

unfortunately, taken error.

 

Example.pbix 

at above link you may find my find pbix file.

 

Regards,

@selpaqm , refer this can work as a new column

Column =
VAR _count= CALCULATE(DistinctCount([Method]) ,FILTER('Table','Table'[salesman/country]=EARLIER('Table'[salesman/country])))+0
return if(_count>1,"Mixed", [method])

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

@selpaqm No access to that file



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

can you please retry it.exampl.pbix 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.