cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## Calculate Season for Different Categories

I have data that has different seasons dependent upon category (see tables) and need a way to calculate these differences. I have a standard date table and a separate table that contains a column for two different rate types. Any help would be greatly appreciated!

Residential:

 Month Season January Winter February Winter March Winter April Winter May Winter June Summer July Summer August Summer September Summer October Winter November Winter December Winter

Commercial

 Month Season January Winter February Winter March Winter April Winter May Summer June Summer July Summer August Summer September Summer October Summer November Winter December Winter

1 ACCEPTED SOLUTION
Community Support

Hi @CMccown ,

According to your description, I create a sample to reproduce your problem.

There're four tables in the sample. Residential and Commercial tables are the same with yours. Here's the other two tables:

Cost table:

Cost table show the cost one day in different season.

Date table:

Suppose you want to calculate the cost of all days in each month per different category. Calculate two measures.

``````CommercialCost =
SUMX (
FILTER ( 'Date', 'Date'[Month] = MAX ( 'Commercial'[Month] ) ),
COUNTROWS ( 'Date' )
* MAXX (
FILTER ( 'Cost', 'Cost'[Season] = MAX ( 'Commercial'[Season] ) ),
'Cost'[Cost]
)
)
``````
``````ResidentialCost =
SUMX (
FILTER ( 'Date', 'Date'[Month] = MAX ( 'Residential'[Month] ) ),
COUNTROWS ( 'Date' )
* MAXX (
FILTER ( 'Cost', 'Cost'[Season] = MAX ( 'Residential'[Season] ) ),
'Cost'[Cost]
)
)
``````

Result:

Residential:

Commercial:

I attach my sample below for your reference.

Best Regards,
Community Support Team _ kalyj

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

Community Support

Hi @CMccown ,

According to your description, I create a sample to reproduce your problem.

There're four tables in the sample. Residential and Commercial tables are the same with yours. Here's the other two tables:

Cost table:

Cost table show the cost one day in different season.

Date table:

Suppose you want to calculate the cost of all days in each month per different category. Calculate two measures.

``````CommercialCost =
SUMX (
FILTER ( 'Date', 'Date'[Month] = MAX ( 'Commercial'[Month] ) ),
COUNTROWS ( 'Date' )
* MAXX (
FILTER ( 'Cost', 'Cost'[Season] = MAX ( 'Commercial'[Season] ) ),
'Cost'[Cost]
)
)
``````
``````ResidentialCost =
SUMX (
FILTER ( 'Date', 'Date'[Month] = MAX ( 'Residential'[Month] ) ),
COUNTROWS ( 'Date' )
* MAXX (
FILTER ( 'Cost', 'Cost'[Season] = MAX ( 'Residential'[Season] ) ),
'Cost'[Cost]
)
)
``````

Result:

Residential:

Commercial:

I attach my sample below for your reference.

Best Regards,
Community Support Team _ kalyj

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors