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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

CY vs PY in Time Series Chart Using Calc Groups

So I'm playing around with calculation groups and they seem good but I've hit a barrier. I want to display a single measure split into CFY and PFY shown as two lines on the same time series chart. The only way I've found of being able to do this is to create two explicit measures using my time intelligence calc group as a filter like so for CFY:

 

Sales CFY = COALESCE(
CALCULATE([Sales],
'Time Intelligence'[Time Segmentation] = "CFY"), 0
)

 

And then the same for PFY. I need to do this for multiple measures though which seems to negate the benefit of calc groups as it means repetition of the same measure definitions across all my measures. Am I missing something or is this a current limitation of calc groups? Thanks in advance!

2 REPLIES 2
Sahir_Maharaj
Super User
Super User

Hello @Anonymous,

 

Can you please try: 

Sales Measure = SELECTEDMEASURE()

Sales CFY = 
CALCULATE(
    [Sales Measure],
    'Time Intelligence'[Time Segmentation] = "CFY"
)

Sales PFY = 
CALCULATE(
    [Sales Measure],
    'Time Intelligence'[Time Segmentation] = "PFY"
)

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Anonymous
Not applicable

Hi Sahir,

 

Thanks for this and I see where you're going but the DAX provided doesn't appear to be valid and results in an error. I think also, you'd need a slicer to switch between the two selected measures. I already have another calculation group that enables this switch functionality but it only allows one measure/Calculation item in the time series chart at one time. I'm wanting to have both the CFY and PFY as two separate lines as if they were two independent measures. But just using a combination of a single measure and two calculation items.

 

After looking into this, I suspect it's not possible tbh. Let me know if I've misunderstood though!

 

Thanks,

 

Luke 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.