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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
bcobrien1977
Helper V
Helper V

Correct Subtotal with a twist

Hi,

I am trying to show project status by quarter and have to fill in quarters where there is no change in activity.

I want the flow distribution column to be 3 (the total for each quarter) 

 

but using the has one value function in measure 3, I get 4.  

Flow distribution is defined as being if the project is active or not in that quarter and I had to fill this in for Q2.

Can someone please help as this is usually so easy so I am wondering why it doesn't work.  Thanks

bcobrien1977_0-1719252909113.png

 

1 ACCEPTED SOLUTION

@bcobrien1977 So, is this the total for the Flow Distribution? And the Flow Distribution is your Feature Epic Story Point Count measure? If this is the case, then it should be something like this:

Flow Distribution Total = 
  VAR __Table = SUMMARIZE( 'vwFiscalCalendar', [Fiscal Year Quarter], "__Value", [Feature Epic Story Point Count] )
  VAR __Result = IF( HASONEVALUE( 'vwFiscalCalendar'[Fiscal Year Quarter]), [Feature Epic Story Point Count], SUMX( __Table, [__Value] ) )
RETURN
  __Result


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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@bcobrien1977 What is your measure formula?



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Total = if(HASONEVALUE('vwFiscalCalendar'[Fiscal Year Quarter]),[Feature Epic Story Point Count],sumx('Flow Distribution','Flow Distribution'Feature Epic Story Point Count]))

 

bcobrien1977_1-1719323075248.png

 

Here is the data. I am trying to get a count of 3 (1 for each row).  It's a bit involved as to how this is dervied because of the data in the gaps and every IssueKey needs a record for every quarter if not done.  

 

Status Text = min('Flow Distribution'[Final Status])
 
STATUTS TEXT DATE = CALCULATE([Status text],CALCULATETABLE(LASTNONBLANK('vwFiscalCalendar'[CalendarDate],CALCULATE([Status text])),DATESBETWEEN('vwFiscalCalendar'[CalendarDate],MINX(ALL('vwFiscalCalendar'),'vwFiscalCalendar'[CalendarDate]),Max('vwFiscalCalendar'[CalendarDate]))))
 
MAX DONE DATE = calculate(max('Flow Distribution'[CreatedOnNext]),'Flow Distribution'[Final Status]="Done")
 
Distribution = if(AND([STATUTS TEXT DATE]="Done",[Done status achieved on]=BLANK()),BLANK(),[STATUTS TEXT DATE])

THanks

@bcobrien1977 So, is this the total for the Flow Distribution? And the Flow Distribution is your Feature Epic Story Point Count measure? If this is the case, then it should be something like this:

Flow Distribution Total = 
  VAR __Table = SUMMARIZE( 'vwFiscalCalendar', [Fiscal Year Quarter], "__Value", [Feature Epic Story Point Count] )
  VAR __Result = IF( HASONEVALUE( 'vwFiscalCalendar'[Fiscal Year Quarter]), [Feature Epic Story Point Count], SUMX( __Table, [__Value] ) )
RETURN
  __Result


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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

Please see above. Thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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