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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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