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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
irenelitw629
Helper II
Helper II

Capture closing number by week number

Hello,

Anyone can teach me how to write a measure to capture closing number of each quarter?

 

My data has weekly closed number by quarter as per below. And I want to write a measure to capture quarter closing number.

In this example, 19-Q1 closing number is at week 13 for $47966 ; 19-Q3 at week 14 for $71328

 

Thank you for your advice.

 

Week1234567891011121314
19-Q160573072914143668430946127607802113659143272547347966 
19-Q2299838543854141351509715097167621944222661226612370524185101414 
19-Q360867134728887449591115711315814474230882469526155307687213371328
19-Q4034370701156201002498729104329765170351859111615119878126729
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @irenelitw629 ,

 

You can perform the "unpivot" operation in "edit queries"

unpivot_other.png

Make sure the "Attribute" column is the type of whole number.

Then you can use DAX like this:

Measure = CALCULATE(
            MAX(Sheet1[Value]),
            FILTER(Sheet1,Sheet1[Attribute]=MAX(Sheet1[Attribute])))
max_measure.PNG

 

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

 

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @irenelitw629 ,

 

You can perform the "unpivot" operation in "edit queries"

unpivot_other.png

Make sure the "Attribute" column is the type of whole number.

Then you can use DAX like this:

Measure = CALCULATE(
            MAX(Sheet1[Value]),
            FILTER(Sheet1,Sheet1[Attribute]=MAX(Sheet1[Attribute])))
max_measure.PNG

 

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

 
amitchandak
Super User
Super User

Are these week numbers based on Qtr and you need qtr trend with the last week in QTR

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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