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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Count Promos which have changed position

Hi all. I have this sample data (my actual data is much larger and complex):

promoposition
aA1
aB1
aC1
bA1
bA1
bB1
cB1
cB1
cB1
dC1
dC1
dC1
eP1
eP1
eP1

 

I want to detect how many unique "promos" have had a changed in "position"? Looking at the table, I can identify that 2 promos have changed position only i.e. promo a and promo b. How can I make a measure that will show me this exact number, without having to count each time because the actual data is big?

 

Thanks in advance 

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

I am not sure how your actual data model looks like, but try the below.

Or share your sample pbix file's link here, then a more accurate measure can be written.

 

Picture1.png

 

Count unique promo that changed in position =
VAR newtable =
FILTER (
SUMMARIZE (
'Table',
'Table'[promo],
'Table'[position],
"@countrow", COUNTROWS ( 'Table' )
),
[@countrow] = 1
)
RETURN
COUNTROWS ( SUMMARIZE ( newtable, 'Table'[promo] ) )+0
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

You can easily create a measure to show results.

Like this:

Measure =
SUMX (
    SUMMARIZE (
        'Table',
        'Table'[promo],
        "a", IF ( DISTINCTCOUNT ( 'Table'[position] ) <> 1, 1, 0 )
    ),
    [a]
)

v-janeyg-msft_0-1621577299419.png

If you still have problems, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

You can easily create a measure to show results.

Like this:

Measure =
SUMX (
    SUMMARIZE (
        'Table',
        'Table'[promo],
        "a", IF ( DISTINCTCOUNT ( 'Table'[position] ) <> 1, 1, 0 )
    ),
    [a]
)

v-janeyg-msft_0-1621577299419.png

If you still have problems, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

I am not sure how your actual data model looks like, but try the below.

Or share your sample pbix file's link here, then a more accurate measure can be written.

 

Picture1.png

 

Count unique promo that changed in position =
VAR newtable =
FILTER (
SUMMARIZE (
'Table',
'Table'[promo],
'Table'[position],
"@countrow", COUNTROWS ( 'Table' )
),
[@countrow] = 1
)
RETURN
COUNTROWS ( SUMMARIZE ( newtable, 'Table'[promo] ) )+0
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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