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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculating Multiple Periods at Once

Hoping someone can help, I imagine it's simple but have been trying for ages, and cant find anything online either.

 

I have a table with a list of clients, all with their own fiscal year. I have another (linked) table with values by period. Finally, i have a table with a list of years to select.

 

I want to sum up the fiscal year by client based on a dropdown, so for example, they select 2019, and it totals the 2019 client fiscal years (some will start in jan 2019, others in apr 2019 etc). I know the dropdown piece, i'm just struggling with how to essentially calculate customer individually with one measure. Can anyone point me in the right direction?

1 REPLY 1
Greg_Deckler
Super User
Super User

This will depend heavily on your data and how it is structured.  Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

But in general, you would do something along the lines of:

Measure =

  VAR __Client = MAX('Table'[Client])

  VAR __Table = 

    SWITCH(__Client,

      "One",ALL('TableOneClient'),

      "Two",ALL('TableTwoClient)

    )

RETURN

<some calculation>


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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