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
Anonymous
Not applicable

Max Function

Dear Experts,

 

i have a table contain lead solds by quarter and by channel as per the below:

 

Area     lead sold     Quarter

A                 50                  Qtr 1

B                 75                   Qtr1

C                100                 Qtr1

A                200                 Qtr2

B                 75                   Qtr2

C                 50                   Qtr2

 and so on till Qtr 4

 

what im trying to do since last week and it didnt work i want to display the max lead sold per quarter and area as an example:

is it possibe to have the below output:

Quarter    lead sold     area

Qtr 1             100                C

Qtr2               200               A

and so on to Q3 and Q4

 

Please advise as nothing that i tried worked with me.

 

Thanks in advance,

N

 

 

 

3 ACCEPTED SOLUTIONS
az38
Community Champion
Community Champion

Sorry, @Anonymous 

my bad. try Rank by SUM

Rank = rankx(filter('Table1';Table1[YearQuarter]=earlier('Table1'[YearQuarter]));sum(Table1[lead sold]))

 also, you could share your pbix-file on any cloud service like https://uploadfiles.io/

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

v-joesh-msft
Solution Sage
Solution Sage

Hi @Anonymous ,

You can try the following methods:
1. Create a calculated column as follows:

 

Quarter = "Q" & INT ( FORMAT ( [Date], "q") )

 

2. Create the following two measures:

 

sum_LS = sum('Table'[Leads_Sold])
Rank = RANKX(ALL('Table'[AREA]),[sum_LS])

 

3. Filter Rank:

21.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ERi36XK2deZJqSrulxj0YjgBr_6f9YvEk0s6U8GYlOJvtg?e=lkjgaE

Best Regards,
Community Support Team _ Joey
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

8 REPLIES 8
Anonymous
Not applicable

Dear All,

 

Thx for the outstanding support. problem has been fixed.

 

Regards,

v-joesh-msft
Solution Sage
Solution Sage

Hi @Anonymous ,

You can try the following methods:
1. Create a calculated column as follows:

 

Quarter = "Q" & INT ( FORMAT ( [Date], "q") )

 

2. Create the following two measures:

 

sum_LS = sum('Table'[Leads_Sold])
Rank = RANKX(ALL('Table'[AREA]),[sum_LS])

 

3. Filter Rank:

21.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ERi36XK2deZJqSrulxj0YjgBr_6f9YvEk0s6U8GYlOJvtg?e=lkjgaE

Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

az38
Community Champion
Community Champion

Hi @Anonymous 

first, you can add a new column rank

Rank = rankx(filter('Table1';Table1[Quarter]=earlier('Table1'[Quarter]));Table1[lead sold]) 

then either filter only values with rank=1 in your visual or create calculated table:

FilteredTable = filter('Table1';Table1[Rank]=1)

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

DATA.png

 

Dear Sir, @az38 

Appologies as i might have populated data already sumarized and that why probably your function didnt work with me, the real data look like the attached file.

 

Please let me know if you required any other clarifications.

 

Thanks in advance

N

 

 

az38
Community Champion
Community Champion

@Anonymous

i woul recommend you to:

1. add a calculated column in your data table 

 

YearQuarter = FORMAT([Date];"YYYY q")

 

2. add a rank column to your data table. it will rank your sold by quarter independ on areas

 

Rank = rankx(filter('Table1';Table1[YearQuarter]=earlier('Table1'[YearQuarter]));Table1[lead sold])

 

then as I told you above either filter only values with rank=1 in your visual or create calculated table:

 

FilteredTable = filter('Table1';Table1[Rank]=1)

 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi @az38 

 

First I really appreciate your support, but you have to excuse my limited knowledge on power bi.

 

i have followed exactly the steps that you mentioned above and still didnt work i have attached a screen shot to show you how the data is being pouplated after creating the rank dax

 

please check image for your referenceResults.pngRegards,

N

az38
Community Champion
Community Champion

Sorry, @Anonymous 

my bad. try Rank by SUM

Rank = rankx(filter('Table1';Table1[YearQuarter]=earlier('Table1'[YearQuarter]));sum(Table1[lead sold]))

 also, you could share your pbix-file on any cloud service like https://uploadfiles.io/

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.