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
jonnyA
Responsive Resident
Responsive Resident

Create a measure to calculate all 4 quarters

Hi, I am trying to create a measure that will sum all 4 quarters.

The following measure was created to calculate the total # of "Patients" for Quarter 1 ...

Patients Qtr 1 =
CALCULATE (
( Charge_Dataset[Patients] ),
FILTER ( '_Charge_Dataset', Quarter(_Charge_Dataset[DOS])= 1 ))
Is there a way to tweak this measure so it calculated all 4 quarters?
Thank you!
6 REPLIES 6
jonnyA
Responsive Resident
Responsive Resident

@v-lionel-msft , 

Thank you for the measure, however, neither worked.  Here are the results that came back with the second measure you gave me, which i renamed "Total Quarters" ("Total Quarters" on the matrix)

PBI 3.11.PNG

v-lionel-msft
Community Support
Community Support

Hi @jonnyA ,

 

It seems that adding this formula directly to the matrix can complete the aggregation of each level.

Patients = SUM(Charge_Dataset[Patients])

 Or try this.

Patients =
CALCULATE (
( Charge_Dataset[Patients] ),
FILTER ( '_Charge_Dataset', Quarter(_Charge_Dataset[DOS])in {1,2,3,4} ))

 If they're useless, please provide a sample .pbix file(remove sensitive information.).

 

Best regards,
Lionel Chen

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

@v-lionel-msft ,

I feel like this measure is so close, however, it is still not correct.  Have any advice on how I can make this work? 

Patients 2 = CALCULATE ( (Charge_Dataset[Total Patients] ), FILTER ( 'Charge_Dataset', Quarter(Charge_Dataset[DOS])in {1,2,3,4} ))
jonnyA_0-1616608114621.png

 

 
 
 
jonnyA
Responsive Resident
Responsive Resident

@Ashish_Mathur , See screen shot below, the total should be 4075 ... not 4073.

jonnyA_0-1615259180358.png

I created quick measures to add quarters 1 and 2.  Then another quick measure add quarters 3 and 4.  Finally, I created another quick measure to add the Sum of Quarters 1 and 2 + the sum of quarters 3 and 4.  

Total Patients =
[Patients Qtr 1 plus Patients Qtr 2] + [Patients Qtr 3 plus Patients Qtr 4]

 

Hi,

I answered your question here - Re: My Total is not summing correctly - Microsoft Power BI Community


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Share some data, explain the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.