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
Sudhavi_84
Helper V
Helper V

Total Including

Hi Experts, I have a measure as below

I have Table1 and Table2, I am just finding the difference of values from between  Table1 Field and Table 2 Field

 

As it is working perfectly in Rows but Grand Total is not coming in Bottom

Test =

VAR Prj = SELECTEDVALUE(Table1[Project])

Var Des = CALCULATE(MAXX(Table2,Table2[DES LBE]),Table2[Project]=prj)

VAR CurrenTotal = CALCULATE(MAXX(Table1,Table1[Current Total of the Prices]),Table1[Project]=prj)

VAR Result = IF(Des <>BLANK(), CurrenTotal-Des,BLANK())

VAR TotalResult = IF(Prj<>BLANK(),Result,BLANK())

 

Return TotalResult

 

 

To get and include the grand total I have to write another measure as below

 

Including Grand Total =

SUMX(Table1,[Test])

 

Any possible to write measure in single measure to acheive grand total as well please?

3 REPLIES 3
v-xulin-mstf
Community Support
Community Support

Hi @Sudhavi_84,

 

Is your issue solved? If the issue has been solved, please adopt the solution to help others.

If you still have some question, please provide your sample data and i will check it in my environment.

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

v-xulin-mstf
Community Support
Community Support

Hi @Sudhavi_84

 

Is your issue solved?

Maybe you can try HASONEVALUE function.

Just like:

IF(
HASONEVALUE(Table[Column]),
Measure,
Grand Total  // calculation logic of total
)

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

lbendlin
Super User
Super User

Please check this function.  By the way this is what the Power BI visuals use behind the scenes.

 

ROLLUPADDISSUBTOTAL function (DAX) - DAX | Microsoft Docs

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.

Top Solution Authors
Top Kudoed Authors