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
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
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