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
boa
Helper I
Helper I

Display a running total percentage on a card

Hello

 

I'm trying to get a running total percentage on a card in a PowerBi report but I get a blanco card.

I have a measure for the running total and for the running total percentage. 

 

I get this matrix:

 

boa_0-1694077290098.png

I want to show the Running Total Percentage of category 3 on a card. (a card with 72,04% on it)

Do I have to make a new measure for this card? I tried some but get always (BLANK) on the card.

 

Many thanks in advance for help!

2 ACCEPTED SOLUTIONS

The card visual has no concept of SELECTEDVALUE.  Use a different aggregation.

View solution in original post

Thank you for your help. I use your code for the running total and now it is working!

boa_0-1694438168842.png

 

 

 

View solution in original post

6 REPLIES 6
v-cgao-msft
Community Support
Community Support

Hi @boa ,

 

Please try:

Running total percentage 3 = 
VAR __numerator = CALCULATE([running total],'Table'[Tijd tss boeking&afspraak_catnr]=3)
VAR __denominator = CALCULATE([running total],ALL())
VAR __result = DIVIDE(__numerator,__denominator)
RETURN
__result

vcgaomsft_0-1694418555676.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Hello,

Thank you for the code. The code for the running total is working but I still get (BLANK) as result in the card.

 

boa_0-1694428196391.png

 

Thank you for your help. I use your code for the running total and now it is working!

boa_0-1694438168842.png

 

 

 

The card visual has no concept of SELECTEDVALUE.  Use a different aggregation.

lbendlin
Super User
Super User

Consider the filter context.  Show your measure code.

Hello,

 

The code I use for the running total is

running total =
CALCULATE (
    SUM ( 'data afspraken - PBI'[Aantal] );
    FILTER (
        ALLSELECTED ( 'data afspraken - PBI' );
        'data afspraken - PBI'[Tijd tss boeking&afspraak_catnr] <= SELECTEDVALUE ( 'data afspraken - PBI'[Tijd tss boeking&afspraak_catnr] )
            && 'data afspraken - PBI'[Start_jaar] = MAX ( 'data afspraken - PBI'[Start_jaar] )
    )
)

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.