Articles in this section
Category / Section

How to Display KPI Card Widget for Month-to-Month Comparison in Bold BI

Published:

This article will guide you through the process of creating a KPI Card widget in Bold BI that displays the difference between the current month and the previous month.

Steps to Create the KPI Card Widget

Step 1: Create Expressions

Consider you have date column named CreatedDate and values in Value. Create the following expressions in Bold BI which helps to compare the values between previous and current month.

  1. Current Month:

    DATEPART("MM",TODAY())
    

    The above expression returns the current month.

  2. Created Month:

    DATEPART("MM",[CreatedDate])
    

    The above expression returns the month of the CreatedDate column value.

  3. Current Year:

    DATEPART("YYYY",TODAY())
    

    The above expression returns the current year

  4. Created Year:

    DATEPART("YYYY",[CreatedDate])
    

    The above expression returns the year of the CreatedDate column value.

  5. Year of Previous Month :

    if([Current Month]=1,[Current Year]-1,[Current Year])
    

    The above expression is used to calculate the year of previous month. For example, If the current month is Jan 2023 then the previous moth is Dec 2023. So that the year of previous month Current Year - 1 which is 2022. If the current month is Mar 2023, then the year of previous month is Feb 2023 and the year is 2023 which is Current Year.

  6. Previous Month:

    if([Current Month]=1,12,[Current Month]-1) 
    

    The above expression check if the month is Jan then it returns Dec as 12 other wise returns Current Month-1

  7. Current Month Values:

    if([Created Month]=[Current Month] AND [Created Year]=[Current Year],[Value],0)
    

    The above expression check if the date is current month and current year, then it will return the value otherwise 0.

  8. Previous Month Values:

    if([Created Month]=[Previous Month] AND [Created Year]=[Year of Previous Month],[Value],0)
    

    The above expression check if the date is previous moth and the year is year of previous month, then it returns the value otherwise 0.

Replace you column name in CreatedDate and Value to calculate the difference between current and previous month.

Step 2: Assign Expressions to KPI Card

Assign the Current Month and Previous Month expressions to the KPI card as shown in the image below:

image.png

Now, the KPI Card widget will display the difference between the current month and the previous month.

image.png

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
IJ
Written by Israel Jebaraj Chandirakumar
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied