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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

KPI Card cannot show YTD

My KPI card

1 ACCEPTED SOLUTION
v-jiewu-msft
Community Support
Community Support

Hi @Anonymous ,

Based on my testing, please try the following methods:

1.Create the sample table.

vjiewumsft_0-1723626316216.png

2.Create the measure to calculate kpi values.

KPI = 
var _numer = SUMX('Table', 'Table'[NUMERATOR])
var _de = SUMX('Table', 'Table'[DENOMINATOR])
RETURN
DIVIDE(_numer, _de)

3.Drag the measure into the card visual. The result is shown below.

vjiewumsft_1-1723626337847.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-jiewu-msft
Community Support
Community Support

Hi @Anonymous ,

Based on my testing, please try the following methods:

1.Create the sample table.

vjiewumsft_0-1723626316216.png

2.Create the measure to calculate kpi values.

KPI = 
var _numer = SUMX('Table', 'Table'[NUMERATOR])
var _de = SUMX('Table', 'Table'[DENOMINATOR])
RETURN
DIVIDE(_numer, _de)

3.Drag the measure into the card visual. The result is shown below.

vjiewumsft_1-1723626337847.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bhanu_gautam
Super User
Super User

@Anonymous , Try using var

 

KPI VALUE =
VAR CumulativeNumerator =
    CALCULATE(
        SUM(G[NUMERATOR]),
        FILTER(
            ALL(G[DateColumn]),
            G[DateColumn] <= MAX(G[DateColumn])
        )
    )

VAR CumulativeDenominator =
    CALCULATE(
        SUM(G[DENOMINATOR]),
        FILTER(
            ALL(G[DateColumn]),
            G[DateColumn] <= MAX(G[DateColumn])
        )
    )

RETURN
    DIVIDE(CumulativeNumerator, CumulativeDenominator)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






bhanu_gautam
Super User
Super User

@Anonymous , Try using below method

 

Create a measure for the cumulative sum of the numerator:

 

Cumulative Numerator =
CALCULATE(
SUM(G[NUMERATOR]),
FILTER(
ALLSELECTED(G),
G[Date] <= MAX(G[Date])
)
)


Create a measure for the cumulative sum of the denominator:
Cumulative Denominator =
CALCULATE(
SUM(G[DENOMINATOR]),
FILTER(
ALLSELECTED(G),
G[Date] <= MAX(G[Date])
)
)

 


Create the KPI value measure using the cumulative sums:
KPI VALUE =
DIVIDE(
[Cumulative Numerator],
[Cumulative Denominator]
)

 

ALLSELECTED(G) ensures that the calculation respects the current context of filters applied in your report.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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