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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ValentinHESS
New Member

Combine Line & column chart with Calculation Group

Hello everyone

 

I am currently trying to use for the first time the claculation group within my financial report.

I created a lot of calculation items 

ValentinHESS_0-1736618088315.png

But I have a problem when I want to create a line & column chart.

In fact I want to display in line both YTD and YTD N-1 and the variation in % on the column part such like this:

ValentinHESS_1-1736618227067.png

But I don't know how to use correctly the calculation group within the build section (below with measures)

ValentinHESS_2-1736618282956.png

 

Could you please help me with it ?

 

Thank you

 

Regards

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

Hi @ValentinHESS 

Based on your description, if you want to display the line & column chart, it is better that you create a new measure instead of using calculation group, you can try the following.

vxinruzhumsft_0-1736737497339.png

There is a calendar table, there is a 1:N reationship between the tables.

Calendar = CALENDAR(DATE(2024,1,1),DATE(2024,12,31))

vxinruzhumsft_1-1736737595775.png

Here is the sample measures i used.

Count = COUNTROWS('Table')
Sum = CALCULATE(SUM('Table'[Value]))

1.Create a new table to put the measure names to the table.

vxinruzhumsft_2-1736737722186.png

2.Create the following measures.

MTD =
IF (
    ISFILTERED ( 'Table (2)'[MeasureName] ),
    SWITCH (
        SELECTEDVALUE ( 'Table (2)'[MeasureName] ),
        "Count", CALCULATE ( [Count], DATESMTD ( 'Calendar'[Date] ) ),
        "Sum", CALCULATE ( [Sum], DATESMTD ( 'Calendar'[Date] ) )
    )
)
YTD =
IF (
    ISFILTERED ( 'Table (2)'[MeasureName] ),
    SWITCH (
        SELECTEDVALUE ( 'Table (2)'[MeasureName] ),
        "Count", CALCULATE ( [Count], DATESYTD ( 'Calendar'[Date] ) ),
        "Sum", CALCULATE ( [Sum], DATESYTD ( 'Calendar'[Date] ) )
    )
)

Then create the visual, and put the ytd and mtd measues to the visual.

vxinruzhumsft_3-1736737843797.png

Then create a slicer and put the measurename to the slicer.

vxinruzhumsft_4-1736737866862.png

 

Output

vxinruzhumsft_5-1736737878069.png

vxinruzhumsft_6-1736737886842.png

And there is another way, you can consider to use two visuals :line chart and column chart so that the calculation group can be put to the legend of the line chart visual.

vxinruzhumsft_7-1736738069616.png

 

Best Regards!

Yolo Zhu

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

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @ValentinHESS 

Based on your description, if you want to display the line & column chart, it is better that you create a new measure instead of using calculation group, you can try the following.

vxinruzhumsft_0-1736737497339.png

There is a calendar table, there is a 1:N reationship between the tables.

Calendar = CALENDAR(DATE(2024,1,1),DATE(2024,12,31))

vxinruzhumsft_1-1736737595775.png

Here is the sample measures i used.

Count = COUNTROWS('Table')
Sum = CALCULATE(SUM('Table'[Value]))

1.Create a new table to put the measure names to the table.

vxinruzhumsft_2-1736737722186.png

2.Create the following measures.

MTD =
IF (
    ISFILTERED ( 'Table (2)'[MeasureName] ),
    SWITCH (
        SELECTEDVALUE ( 'Table (2)'[MeasureName] ),
        "Count", CALCULATE ( [Count], DATESMTD ( 'Calendar'[Date] ) ),
        "Sum", CALCULATE ( [Sum], DATESMTD ( 'Calendar'[Date] ) )
    )
)
YTD =
IF (
    ISFILTERED ( 'Table (2)'[MeasureName] ),
    SWITCH (
        SELECTEDVALUE ( 'Table (2)'[MeasureName] ),
        "Count", CALCULATE ( [Count], DATESYTD ( 'Calendar'[Date] ) ),
        "Sum", CALCULATE ( [Sum], DATESYTD ( 'Calendar'[Date] ) )
    )
)

Then create the visual, and put the ytd and mtd measues to the visual.

vxinruzhumsft_3-1736737843797.png

Then create a slicer and put the measurename to the slicer.

vxinruzhumsft_4-1736737866862.png

 

Output

vxinruzhumsft_5-1736737878069.png

vxinruzhumsft_6-1736737886842.png

And there is another way, you can consider to use two visuals :line chart and column chart so that the calculation group can be put to the legend of the line chart visual.

vxinruzhumsft_7-1736738069616.png

 

Best Regards!

Yolo Zhu

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

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 MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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