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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.