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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Marshmallow
Helper II
Helper II

Help with creating double chart line to compare current FY vs prev FY

Hi,

 

I am hoping there is a simple way to do this. Here is sample data.

 

Can someone please help me with the dax script to create double line chart with Month as X-axis and Count (date signed) with condition only count date signed that has: PA, PA1, PA2 on it. Also to hide Oct onwards for year 2025 as there is no data.

 

Then comes next financial year, it will automatically switch graph to show FY25-26 and FY 26-27

 

 

 

Date_signedCondition
1/7/24PA
31/7/24PA1
15/8/24PA2
19/9/24AAA
30/9/24PA1 
10/10/24PA2
12/10/24AAA
13/10/24PA1
12/11/24PA2
7/12/24PA
2/12/24PA1 
3/12/24PA2
4/1/25PA
31/2/25PA1
15/3/25PA2
19/4/25PA
20/5/25PA1 
10/5/25PA2
23/6/25PA
13/7/25PA1
12/7/25PA2
7/8/25PA
2/9/25PA1 
15/9/25PA2

 

 

 

The chart needs to look like:

Marshmallow_0-1757896324425.png

Hopefully someone able to assist as at the moment i think i have done the inefficient way.

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I assume fiscal year starts every March.

I tried to create calendar table, and please check the below picture and the attached pbix file if it suits your inquiry.

Jihwan_Kim_1-1757904836777.png

 

Jihwan_Kim_0-1757904774793.png

 

Count: = 
CALCULATE ( COUNTROWS ( data ), data[Condition] IN { "PA", "PA1", "PA2" } )

 

current year: = 
VAR _currentyear =
    YEAR ( CALCULATE ( MAX ( data[Date_signed] ), REMOVEFILTERS () ) )
VAR _currentfiscalyear =
    MAXX (
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Calendar Year] = _currentyear ),
        'Calendar'[Fiscal Year]
    )
VAR _count =
    CALCULATE (
        [Count:],
        'Calendar'[Fiscal Year] = _currentfiscalyear
    )
RETURN
    _count

 

previous year: = 
VAR _currentyear =
    YEAR ( CALCULATE ( MAX ( data[Date_signed] ), REMOVEFILTERS () ) )
VAR _currentfiscalyearsort =
    MAXX (
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Calendar Year] = _currentyear ),
        'Calendar'[Fiscal Year sort]
    )
VAR _count =
    CALCULATE (
        [Count:],
        'Calendar'[Fiscal Year sort] = _currentfiscalyearsort - 1
    )
RETURN
    IF ( [current year:], _count )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

From which month does the FY start?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish - Fin year starts from 1 July yyyy and ends on 30 June yyyy+1

PBI file attached.

Ashish_Mathur_0-1757991460257.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Jihwan_Kim
Super User
Super User

Hi,

I assume fiscal year starts every March.

I tried to create calendar table, and please check the below picture and the attached pbix file if it suits your inquiry.

Jihwan_Kim_1-1757904836777.png

 

Jihwan_Kim_0-1757904774793.png

 

Count: = 
CALCULATE ( COUNTROWS ( data ), data[Condition] IN { "PA", "PA1", "PA2" } )

 

current year: = 
VAR _currentyear =
    YEAR ( CALCULATE ( MAX ( data[Date_signed] ), REMOVEFILTERS () ) )
VAR _currentfiscalyear =
    MAXX (
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Calendar Year] = _currentyear ),
        'Calendar'[Fiscal Year]
    )
VAR _count =
    CALCULATE (
        [Count:],
        'Calendar'[Fiscal Year] = _currentfiscalyear
    )
RETURN
    _count

 

previous year: = 
VAR _currentyear =
    YEAR ( CALCULATE ( MAX ( data[Date_signed] ), REMOVEFILTERS () ) )
VAR _currentfiscalyearsort =
    MAXX (
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Calendar Year] = _currentyear ),
        'Calendar'[Fiscal Year sort]
    )
VAR _count =
    CALCULATE (
        [Count:],
        'Calendar'[Fiscal Year sort] = _currentfiscalyearsort - 1
    )
RETURN
    IF ( [current year:], _count )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Irwan
Super User
Super User

hello   

i would do like this (not sure if this same as yours).

 

create two measures for Current FY and Prev FY with following DAX

Current FY =
CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        YEAR('Table'[Date_signed])=YEAR(TODAY())&&
        ('Table'[Condition]="PA"||'Table'[Condition]="PA1"||'Table'[Condition]="PA2")
    )
)
Prev FY =
CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        YEAR('Table'[Date_signed])=YEAR(TODAY())-1&&
        ('Table'[Condition]="PA"||'Table'[Condition]="PA1"||'Table'[Condition]="PA2")
    )
)
then create another measure for display (seems you want to show when both have value).
Show =
IF(
    ISBLANK([Prev FY])||ISBLANK([Current FY]),
    0,
    1
)
  

 

Hope this will help.

Thank you.

Irwan_2-1757901476352.png

Irwan_0-1757901287544.png

@Marshmallow

Where is the months post Sept? It needs to be displayed too as 2024 has data in it.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.