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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Naveeduddin
Frequent Visitor

Advanced Formulae

Hi All,

 

I'm working on automating our excel reports to PowerBI and in few cases we have an incremental addition from day 1 and in another case an addition of one year above.

 

Attached below link has the sample data. Highlied in Yellow values need to be transformed in PowerBI (Column E & F), Kinldy help.

 

https://docs.google.com/spreadsheets/d/1GlcUWtb1hYPf8l1RVgIgz6JxTug30zobTo0BT_5nxL4/edit#gid=0

 

Regards

Naveed

2 ACCEPTED SOLUTIONS
PaulDBrown
Community Champion
Community Champion

Create a dimension table for year and create a single to many relationship with the main table:

model.png

 Use this 'Year Table'[dYear] field in the visual.

Create and format the following measures:

Sum Existing = 
SUM(fTable[Existing])
Sum New = 
SUM(fTable[New])
Total = 
[Sum Existing] + [Sum New]
Running Total New =
CALCULATE (
    [Sum New],
    FILTER (
        ALL ( 'Year Table' ),
        'Year Table'[dYear] <= MAX ( 'Year Table'[dYear] )
    )
)
Renewal % =
VAR _PY =
    CALCULATE (
        [Running Total New],
        FILTER (
            ALL ( 'Year Table' ),
            'Year Table'[dYear]
                = MAX ( 'Year Table'[dYear] ) - 1
        )
    )
RETURN
    DIVIDE ( [Sum Existing], _PY )
Renewal % based on LY =
VAR _PY =
    CALCULATE (
        [Total],
        FILTER (
            ALL ( 'Year Table'[dYear] ),
            'Year Table'[dYear]
                = MAX ( 'Year Table'[dYear] ) - 1
        )
    )
RETURN
    DIVIDE ( [Sum Existing], _PY )

result.png

 

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

This is awesome! It worked, Thank you very much 🙂

View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

Create a dimension table for year and create a single to many relationship with the main table:

model.png

 Use this 'Year Table'[dYear] field in the visual.

Create and format the following measures:

Sum Existing = 
SUM(fTable[Existing])
Sum New = 
SUM(fTable[New])
Total = 
[Sum Existing] + [Sum New]
Running Total New =
CALCULATE (
    [Sum New],
    FILTER (
        ALL ( 'Year Table' ),
        'Year Table'[dYear] <= MAX ( 'Year Table'[dYear] )
    )
)
Renewal % =
VAR _PY =
    CALCULATE (
        [Running Total New],
        FILTER (
            ALL ( 'Year Table' ),
            'Year Table'[dYear]
                = MAX ( 'Year Table'[dYear] ) - 1
        )
    )
RETURN
    DIVIDE ( [Sum Existing], _PY )
Renewal % based on LY =
VAR _PY =
    CALCULATE (
        [Total],
        FILTER (
            ALL ( 'Year Table'[dYear] ),
            'Year Table'[dYear]
                = MAX ( 'Year Table'[dYear] ) - 1
        )
    )
RETURN
    DIVIDE ( [Sum Existing], _PY )

result.png

 

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






This is awesome! It worked, Thank you very much 🙂

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors