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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

QUARTER problem

Dear community members,
Although from the first look issue seemed to be easy, I as a beginner still can not solve it.

I made calculated column Quarter = QUARTER([Date]), which perfectly returns quarters (1,2,3,4) both in data model and in slicer (4 options for quarters). I need different measures for each of quarter, i.e., IF (Quarter = 1, measure A, (IF Quarter = 2, measure B, (IF Quarter = 3, measure C, (IF Quarter = 4, measure D)))), so Quarter would be a reference to calculate 4 different measures.

But, because of row context (data model has many columns) Quarter function returns all instances of Quarters associated with [Date], which is shown in matrix table (such result also in Power BI) below.

Ervins1975_0-1639750359349.png

[Date] dimension is quarterly based.

Some function/ group of functions are needed which tell that there are only 4 cases of Quarters.  I.e. something opposite ALL function, which not excludes, but includes row context of other columns of data model. I tried to manipulate QUARTER([Date]) with other functions, but QUARTER function seems not to like it.

Any ideas?:)
Regards,

 

Ervins

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

When inserting the quarter column, it sums it. Instead, you can create your measure as follows:

Measure = 

SWITCH(
    MAX( Table1[Quarter] ),
    1, [Measure A ],
    2, [Measure B ],
    3, [Measure C ],
    4, [Measure D ]
)


Or, without the help of the Quarter column

Measure = 

SWITCH(
     QUARTER( MAX (Table1[Date] )),
    1, [Measure A ],
    2, [Measure B ],
    3, [Measure C ],
    4, [Measure D ]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@Anonymous 

When inserting the quarter column, it sums it. Instead, you can create your measure as follows:

Measure = 

SWITCH(
    MAX( Table1[Quarter] ),
    1, [Measure A ],
    2, [Measure B ],
    3, [Measure C ],
    4, [Measure D ]
)


Or, without the help of the Quarter column

Measure = 

SWITCH(
     QUARTER( MAX (Table1[Date] )),
    1, [Measure A ],
    2, [Measure B ],
    3, [Measure C ],
    4, [Measure D ]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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