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
Arvind_123
Helper I
Helper I

common keyword vs new keyword

Hi Team,


I have column like month, keyword name from this I want to fetch common keyword arrival and new keyword arrival as compare to previous month.

how to do this in power bi dax.

 

Thanks,

Arvind

1 ACCEPTED SOLUTION

there could be a few ways of doing this, depending on the nuances that i am not aware of, however this should give you a flavour of how you can do it.

 

here is the code and i attach the pbix. let me know if you have any questions

 

 

just to note that i converted your month value to a date value

 

Keyword Type =
VAR dte = //get last months date
    DATEADD(LASTDATE ( 'month_keyword'[Date] ),-1,MONTH)
VAR keywords = //select current keyword against current date
    SELECTEDVALUE ( month_keyword[Keyword] )
VAR match = //see if keyword existed previous month, if so count 1
    CALCULATE (
        COUNTROWS ( month_keyword ),
        month_keyword[Date] = dte
            && month_keyword[Keyword] = keywords
    )
RETURN //if no rows then new else common
    IF ( match > 0, "common", "new" )




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
vanessafvg
Super User
Super User

can you provide some sample data with an example of what you are expecting?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hi @vanessafvg ,

Please find the table.

 

Input Output
Monthkeyword MonthKeywordCommon/New
OctA NovACommon
OctB NovBCommon
OctC NovCCommon
OctD NovDCommon
OctE NovXNew
OctF NovYNew
OctG    
NovA    
NovB    
NovC    
NovD    
NovX    
NovY    

 

Thanks,

Arvind

there could be a few ways of doing this, depending on the nuances that i am not aware of, however this should give you a flavour of how you can do it.

 

here is the code and i attach the pbix. let me know if you have any questions

 

 

just to note that i converted your month value to a date value

 

Keyword Type =
VAR dte = //get last months date
    DATEADD(LASTDATE ( 'month_keyword'[Date] ),-1,MONTH)
VAR keywords = //select current keyword against current date
    SELECTEDVALUE ( month_keyword[Keyword] )
VAR match = //see if keyword existed previous month, if so count 1
    CALCULATE (
        COUNTROWS ( month_keyword ),
        month_keyword[Date] = dte
            && month_keyword[Keyword] = keywords
    )
RETURN //if no rows then new else common
    IF ( match > 0, "common", "new" )




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




are you only ever only looking at the previous month, or are you looking at all previous months?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hi @vanessafvg ,

I am looking for previous month and current month comparison.

 

Thanks,

Arvind

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.