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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
sonuojha1
Helper IV
Helper IV

Grand total in measure for selected years

Hello All,

I was trying to get Yearly GRAND TOTAL in to a measure,

 

CALCULATE([MEASURE],ALLEXCEPT('Dim - Date', 'Dim - Date'[Year]))
CALCULATE([MEASURE],ALLEXCEPT('Dim - Date', 'Dim - Date'[Month]))
CALCULATE([MEASURE],ALLEXCEPT('Dim - Date', 'Dim - Date'[Date]))

 But still I couldn't get what I am looking for.

I need yearly Grand Total in measure for example selected year = 2020, then grand total measure should show 548,125. Measure is giving sum of entire data for that column.

 

sonuojha1_0-1608150832822.png

 

Regards,

Sonu

 

1 ACCEPTED SOLUTION

Hi @sonuojha1 ,

 

Modify the measure as below.

Yrly Grand Total = CALCULATE(sum('Fact - Data'[VALUE1]),FILTER(ALL('Dim - Date'),'Dim - Date'[Date].[Year] in VALUES('Dim - Date'[Date].[Year])))

Result would be shown as below.

1.PNG

2.PNG

3.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Ensure that:

  1. There is a relationhip from the Date column in your Data Table to the Date column in your Dim - Date Table
  2. To your slicers and the visual, you have dragged Year and Month from the Dim - Date Table.
  3. Write this measure

=calculate([measure],allexcept('dim - date','dim - date'[year]))

If this does not help, then share the link from where i can download your PBI file.


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

Thanks for reply Ashish,

 

Yes offcourse, I have a join with my date dimension. May be you couldn't understand my query.

Whatever the grand total I am getting that is giving me entire data grand total. However I am looking for Yearly subtotal in a measure.

 

sonuojha1_0-1608201041041.png

https://drive.google.com/file/d/1ihvtkKfZGGqZtCzKlEqMtJy2zZtSlvxP/view?usp=sharing 

Hi @sonuojha1 ,

 

Modify the measure as below.

Yrly Grand Total = CALCULATE(sum('Fact - Data'[VALUE1]),FILTER(ALL('Dim - Date'),'Dim - Date'[Date].[Year] in VALUES('Dim - Date'[Date].[Year])))

Result would be shown as below.

1.PNG

2.PNG

3.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi,

Download the PBI file from here.

Hope this helps.

Untitled.png


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

@sonuojha1 - This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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