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
jl20
Helper IV
Helper IV

Embedding Summary Table within a Measure

Hi all,

 

I'm trying to figure out how to summarize a table within a measure. An example is the easiest way to show what I'm trying to achieve:

 

Data table is as follows:

Job #          Revenue         Client Name

1                 $50                 John Doe

25               $150               John Doe

25               $250               John Doe

44               $100               John Doe

100             $99                 John Doe

55              $100                Mr. X

 

Desired Output Table:

Client          Total Revenue      Max Job     Min Job      Job Count

John Doe     $550                     $400          $50             3

Mr. X            $100                    $100           $100           1

 

Total revenue is solved using a simple Sum function, but how would I solve for max/min jobs, and also the count? I originally made a separate summary table but then my relationships would not work as expected when I used slicers.

 

Any help would be greatly appreciated!

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@jl20,

What is the logic when you calculate Total Revenue, Max Job and Job count for John Doe? Based on your data table,  John has four distinct jobs,  and you can create the following measures in your table.

Total Revenue = SUM(Table1[Revenue])
Max Job = MAX(Table1[Revenue])
Min job = MIN(Table1[Revenue])
Job Count = DISTINCTCOUNT(Table1[Job #])

 1.PNG

Or if you want to return max job according to Job #, you can create a summary table using the DAX below, then create measures using above similar formulas as in the new table.

Table = SUMMARIZE(Table1,Table1[Client Name],Table1[Job #],"Revenue", SUM(Table1[Revenue]))

2.PNG
Regards,

Community Support Team _ Lydia Zhang
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-yuezhe-msft
Employee
Employee

@jl20,

What is the logic when you calculate Total Revenue, Max Job and Job count for John Doe? Based on your data table,  John has four distinct jobs,  and you can create the following measures in your table.

Total Revenue = SUM(Table1[Revenue])
Max Job = MAX(Table1[Revenue])
Min job = MIN(Table1[Revenue])
Job Count = DISTINCTCOUNT(Table1[Job #])

 1.PNG

Or if you want to return max job according to Job #, you can create a summary table using the DAX below, then create measures using above similar formulas as in the new table.

Table = SUMMARIZE(Table1,Table1[Client Name],Table1[Job #],"Revenue", SUM(Table1[Revenue]))

2.PNG
Regards,

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

That worked well, thanks!

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.