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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gvg
Post Prodigy
Post Prodigy

Summing the displayed results of a measure

Hi,

I've read a thread with the similar title, but my case is somewhat different. I have a measure:

 

New clients = IF([Sales in Previous Period]=0 && [Sales in Last Selected Month]>0
                          ,1
                          ,0)

 

How do I sum the New clients measure? I failed to do it with COUNT, as it requires a column reference as an argument.

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

w/o having more details about you model I guess you could use an iterator like this:

 

CALCULATE 
  (SUMX(
    VALUES('yourtable'[clientid])
    ,IF([Sales in Previous Period]=0 && [Sales in Last Selected Month]>0
                          ,1
                          ,BLANK())
)

 

I just replaced the zero from the FALSE part of the IF statement with BLANK(), avoiding to add meaningless values (from my point of view) to the RAM.

 

Hope this gets you started

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

w/o having more details about you model I guess you could use an iterator like this:

 

CALCULATE 
  (SUMX(
    VALUES('yourtable'[clientid])
    ,IF([Sales in Previous Period]=0 && [Sales in Last Selected Month]>0
                          ,1
                          ,BLANK())
)

 

I just replaced the zero from the FALSE part of the IF statement with BLANK(), avoiding to add meaningless values (from my point of view) to the RAM.

 

Hope this gets you started

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

@TomMartens , 

 

Yep, that works. Thank you very much.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.