cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Sum of a measure in row total

Hi,

 

Hoping someone can help!

 

I have a very simple measure based on a set of data that I want a trigger above 2499 as a value:

 

Trigger = if([Total Business Miles]>2499, 1,0)

 

All works well but then I am looking at it monthly and want to know how many of the last three months this has been reached. The total is showing 1 though as it is treating that as the measure also. Thus if the trigger is breached 3 times I want the total to be 3 not 1.

 

Does that make sense? Can anyone help

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Sum of a measure in row total

Try to change the ALL ( 'Dates'[MonthName] ) to

ALLSELECTED( 'Dates'[MonthName] )

Regards,
MFelxi

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Sum of a measure in row total

Hi @GJLeslie,

 

You need to create a measure like this:

Trigger_Count =
IF (
    HASONEVALUE ( 'Bussines Miles'[Total Bussines Miles] ),
    [Trigger],
    SUMX ( ALL ( 'Bussines Miles'[Date] ), [Trigger] )
)

Final result below (don't know if want to use a table with date / trigger):

trigger.png

 

Regard,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





Highlighted
Regular Visitor

Re: Sum of a measure in row total

@MFelixMany thanks works a treat ! One slight build - I select months within years but the total is giving me the full year - is there a way of fixing that? Viusal:

 

Capture.PNG

The current formula I have is:

 

Trigger Count = IF (
    HASONEVALUE ( 'Internal Mileage Report'[Business Miles] ),
    [BM Trigger],
    SUMX ( ALL ( 'Dates'[MonthName] ), [BM Trigger] )
)

 

Thus when I click on October it is giving me the count for the full year

 

Hope you can help!

 

Cheers

Highlighted
Super User III
Super User III

Re: Sum of a measure in row total

Try to change the ALL ( 'Dates'[MonthName] ) to

ALLSELECTED( 'Dates'[MonthName] )

Regards,
MFelxi

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

Highlighted
Regular Visitor

Re: Sum of a measure in row total

@MFelixMagic - many thanks

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors