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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Powerbi Desktop - Line item value Vs. Grand Total

Folks

 

I have the following columns in my report

 

Industry                                Watch             Rating

Agri                                       4.3 %                   1

Mining                                   3.2  %                  1

Manufacturing                       1.4  %                  1

Oil & Gas                                6.7  %                 2

GRAND TOTAL                       5.6 %

 

The Watch is computed using a formula. What I need is if the individual Watch  item value > Grand Total, then 2, else 1, as 'Rating'.  Is there a way I can store the Grand Total in a 'global' kind of variable, and then compare the individual row value against this global variable and return 1 or 2?

 

Thanks in advance!

 

2 ACCEPTED SOLUTIONS

try this measure

Rating=VAR _WatchTotal=CALCULATE([Watch],ALL('industry'[industry])) RETURN IF([Watch]<_WatchTotal,1,2)

View solution in original post

@Anonymous 

 

You may try the following measure:

 

Rating = 
VAR _Overall =
    CALCULATE ( [Watch %], ALL ( Industry[Industry] ) )
VAR _Rating =
    IF ( HASONEVALUE ( Industry[Industry] ), IF ( [Watch %] > _Overall, 2, 1 ) )
RETURN
    _Rating

 

where 

 

Watch % = 
DIVIDE (
    SUM ( Industry[gloan] ) + SUM ( Industry[wloan] ),
    SUM ( Industry[CurrVal] )
)

 

Result:

 

image.png

 

Cheers!
Vivek

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

 

 

 

 

View solution in original post

4 REPLIES 4
vivran22
Community Champion
Community Champion

Hey @Anonymous ,

 

As per your description, Grand Total of watch is based on a formula, and I am guessing it is a measure. 

If this is true, then you can use the measure in your formula:

image.png

 

If this is not the case, then please share details on how you are calculating the Grand Total.

 

Cheers!
Vivek

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

Anonymous
Not applicable

Hi @vivran22 

 

Thanks for your reply.  The Watch is a calculated measure Watch (%) = (sum('Industry'[gloan]+sum('Industry'[wloan]))/sum('Industry'[CurrVal]), based on the Industry columns.  As its a matrix report, the Grand Total is enabled from the Format Painter (Sub Totals 'on') and the value is computed and there's  no Grand Total measure as such. 

 

Thanks!

@Anonymous 

 

You may try the following measure:

 

Rating = 
VAR _Overall =
    CALCULATE ( [Watch %], ALL ( Industry[Industry] ) )
VAR _Rating =
    IF ( HASONEVALUE ( Industry[Industry] ), IF ( [Watch %] > _Overall, 2, 1 ) )
RETURN
    _Rating

 

where 

 

Watch % = 
DIVIDE (
    SUM ( Industry[gloan] ) + SUM ( Industry[wloan] ),
    SUM ( Industry[CurrVal] )
)

 

Result:

 

image.png

 

Cheers!
Vivek

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

 

 

 

 

try this measure

Rating=VAR _WatchTotal=CALCULATE([Watch],ALL('industry'[industry])) RETURN IF([Watch]<_WatchTotal,1,2)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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