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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Rehab_hassan
Frequent Visitor

create a measure to extract Quarter and year

opportunities.JPG

 

hello team,

 

I need to create a measure (not a coloumn) as I am getting my data from a services data analysis services and i caanot create coloumns.

 

A measure should extract quarter from the (created on) coloumn in the pic attached and another measure to extract the year as well.

 

any help is more than apperciated.

 

 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Rehab_hassan ,

 

You need to create something like this:

 

Month = MONTH(MAX(Opportunities[Created On])))



Quarter =
SWITCH (
    TRUE ();
    MONTH ( MAX ( Opportunities[Created On])) ) <= 3; "Q1";
    MONTH ( MAX ( Opportunities[Created On]) ) ) <= 6; "Q2";
    MONTH ( MAX ( Opportunities[Created On])) ) <= 9; "Q3";
    "Q4"
)

Regards,

MFelix

 

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Rehab_hassan ,

 

You need to create something like this:

 

Month = MONTH(MAX(Opportunities[Created On])))



Quarter =
SWITCH (
    TRUE ();
    MONTH ( MAX ( Opportunities[Created On])) ) <= 3; "Q1";
    MONTH ( MAX ( Opportunities[Created On]) ) ) <= 6; "Q2";
    MONTH ( MAX ( Opportunities[Created On])) ) <= 9; "Q3";
    "Q4"
)

Regards,

MFelix

 

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors