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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
zaka88
Frequent Visitor

Display measure in subtotal for one row in matrix

hi

i have matrix with 3 rows and i want display subtotals for each row in matrix but create measure for one row

 

example:

i need to display Table1[values] for each row except total for date row

for subtotal of date row i need to display Table1[diff]:

zaka88_0-1618324773617.png

 

but also i need to display Table1[values] in subtotals for rows Group 1 and Group 2:

zaka88_1-1618324915606.png

 

i was playing with hasonevalue and isinscope functions but no success (i've created measure which displays table1[diff] in all subtotals instead of just in subtotal for date row)

 

 

here a link to pbi file

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

 

thanks 

 

1 ACCEPTED SOLUTION

Hi  @zaka88 ,

 

The two values below have the same meaning ,which means they should keep the same:

v-kelly-msft_0-1618796311590.png

v-kelly-msft_1-1618796320311.png

So do you want it to be -17 or 1904?

 

Best Regards,
Kelly

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

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@zaka88 , I think isinscope should help you 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

i hope that it helps me, but i have no idea how to use it in right way.

results of using isinscope() are same for group2 row and for date row, but i need to display value just for date row...

zaka88_0-1618331914631.png

 

Hi @zaka88 ,

 

Create a measure as below:

Measure = 
IF(ISINSCOPE(Table1[group 2]),[diff],
CALCULATE(SUM('Table1'[Value]),FILTER(ALL(Table1),'Table1'[group 1]=MAX('Table1'[group 1]))))

And you will see:

v-kelly-msft_0-1618475363898.png

If I misunderstood your point,pls correct me.

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

 

 

thanks for your comment.

but i need display [diff] in subtotal for date

and SUM('Table1'[Value]) in all other rows (for values and for subtotals of group1 and group2).



result should be like that:

zaka88_0-1618476311189.png

 

Hi  @zaka88 ,

 

Create a measure as below:

Measure = 
var _fir= ISINSCOPE('Calendar'[Date])
var _sec=ISINSCOPE(Table1[group 2])
var _thi=ISINSCOPE(Table1[group 1])
return
IF(_fir&&_sec&&_thi, [Values] ,IF((_fir=FALSE())&&_sec&&_thi,[Value at max date]-[Value at min date],IF((_fir=FALSE())&&(_sec=FALSE())&&_thi,CALCULATE(SUM('Table1'[Value]),FILTER(ALL(Table1),'Table1'[group 1]=MAX('Table1'[group 1]))))))

And you will see:

v-kelly-msft_0-1618537966543.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

yeah, almost done. just need change value in subtotal for group2:

 

zaka88_0-1618567592096.png

 

thanks a lot for your help

Hi  @zaka88 ,

 

The two values below have the same meaning ,which means they should keep the same:

v-kelly-msft_0-1618796311590.png

v-kelly-msft_1-1618796320311.png

So do you want it to be -17 or 1904?

 

Best Regards,
Kelly

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

yes, now i understand that this 2 values have the same meaing.... 

thanks

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.