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
pprakash
Helper I
Helper I

Summarize data according to max event_id

HI

 

my main table is 

id,requisition_id,requisition_event_id,upload_link,created_by,updated_by,created_at,updated_at
220991 50450407-10-2018 20:0607-10-2018 20:06
2211001 59659608-10-2018 11:3508-10-2018 11:35
2571002 1108-10-2018 20:2108-10-2018 20:21
3231004 323209-10-2018 11:2109-10-2018 11:21
2221011 59659608-10-2018 11:4008-10-2018 11:40
2561012 1108-10-2018 20:2108-10-2018 20:21
3201013 323209-10-2018 11:2009-10-2018 11:20
3211015 323209-10-2018 11:2009-10-2018 11:20
2231021 59659608-10-2018 11:4708-10-2018 11:47
2551022 1108-10-2018 20:2108-10-2018 20:21
3191024 323209-10-2018 11:2009-10-2018 11:20
2241031 41941908-10-2018 12:2508-10-2018 12:25
3411032 42442409-10-2018 16:2909-10-2018 16:29
3531033 323209-10-2018 17:2009-10-2018 17:20
3691035 60660610-10-2018 10:2010-10-2018 10:20
2251041 41941908-10-2018 12:2708-10-2018 12:27
2541042 1108-10-2018 20:2008-10-2018 20:20
3181043 323209-10-2018 11:1909-10-2018 11:19

 

i ahve created measure from above table :  Measure name is Max ID

 MaxID = MAx('eta requisition_life_cycles'[requisition_event_id]) 

 

then i created a visualization with measure max id and drag requisition_id column in clustered column chart i get data as

MaxIDrequisition_id
199
4100
5101
4102
5103
4104
5105
4106
5107
5108
4109
5110
5111
4112
5113
5114
5115
5116
5117

 

 

but i need data as( Max id is max requisition_event_id of a group of requisition_id

 

Max IDCount of requisition_id
135
232
314
4129
5229
617
7117
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @pprakash

After my test, you may try to this way as below:

Step1: Add a calculate column

Use EARLIER Function to find MAX("requisition_event_id") for each "requisition_id"

MaxEventID = 
CALCULATE (
    MAX ( 'eta requisition_life_cycles'[requisition_event_id] ),
    FILTER (
        'eta requisition_life_cycles',
        'eta requisition_life_cycles'[requisition_id]
            = EARLIER ( 'eta requisition_life_cycles'[requisition_id] )
    )
)

1.JPG

Step2: Add a calculate measure

Add a measure that Count (requisition_id)

Count of requisition_id = CALCULATE(COUNTA('eta requisition_life_cycles'[requisition_id]))

Step3: Create a visual

Drag the field MaxEventID and measure Count of requisition_id into visual

2.JPG

 

Best Regards,
Lin

 

 

Community Support Team _ Lin
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

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hi, @pprakash

After my test, you may try to this way as below:

Step1: Add a calculate column

Use EARLIER Function to find MAX("requisition_event_id") for each "requisition_id"

MaxEventID = 
CALCULATE (
    MAX ( 'eta requisition_life_cycles'[requisition_event_id] ),
    FILTER (
        'eta requisition_life_cycles',
        'eta requisition_life_cycles'[requisition_id]
            = EARLIER ( 'eta requisition_life_cycles'[requisition_id] )
    )
)

1.JPG

Step2: Add a calculate measure

Add a measure that Count (requisition_id)

Count of requisition_id = CALCULATE(COUNTA('eta requisition_life_cycles'[requisition_id]))

Step3: Create a visual

Drag the field MaxEventID and measure Count of requisition_id into visual

2.JPG

 

Best Regards,
Lin

 

 

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

You don't need to use the MAX() function. Just drag the Requestion Event ID to a table and then in the dropdown in the Values section on the right, tell it "Don't summarize"

 

Then use the following measure to count the number of Requestion IDs for each Event ID.

 

Requistion ID Count = COUNT('eta requisition_life_cycles'[requisition_id])

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@edhans as you can see there are n numbers of requisition_event_id for one requisition_id. i need max event id for requisition_id then i need count of requisition_id for that max event ids 

Ok. See if this file is what you need. I used Power Query to determine the Max Event ID for each type of requestion ID in a separate table that is NOT loaded. Then I merged that table back to the original table, then used a simple COUNT() measure.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

hi @edhans i think i can get the exact result. as i am new in power bi can u pls help me to create power query for max event id table.

It was in the file I linked to. Click the "Edit Queries" button on the home ribbon.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.