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

 

hi , i have created a measure MaxID and drag column Requisition_id to get a clustered column visualization. the data came as:

 

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

 

actual data i need is given below:

 

Max IDCount of requisition_id
135
232
314
4129
5229
617
7117

 

 

please help.

1 ACCEPTED SOLUTION

Hi @pprakash

From you information, MaxID should be the max requisition_event_id per requisition_idCount of requisition_id should be the count of requisition_id per MaxID, right?

 

in my test, [Measure] is the  MaxID, i could also create a calculated column max to replace it, then create another column count for Count of requisition_id.

count = CALCULATE(COUNT(Sheet1[requisition_id,]),ALLEXCEPT(Sheet1,Sheet1[max]))

max = CALCULATE(MAX([requisition_event_id,]),ALLEXCEPT(Sheet1,Sheet1[requisition_id,]))

 

 2.png

Or if you need distintcount, you can use the following formula

distintcount = CALCULATE(DISTINCTCOUNT(Sheet1[requisition_id,]),ALLEXCEPT(Sheet1,Sheet1[max]))

 

Best Regards

Maggie

 

 

 

View solution in original post

12 REPLIES 12
PattemManohar
Community Champion
Community Champion

@pprakash It will be great if you can share the sample data on which you have created the measure. Also, DAX formula that you used to create the measure.




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




hi @PattemManohar thanks for reply:

 

Dax formula for Max ID is MaxID = MAx('eta requisition_life_cycles'[requisition_event_id]) 

 

and table is 

id event_name, sequencerequired, requires_upload created_atupdated_at
1Created By User | Awaiting HOD's Approval11022-06-2018 7:2422-06-2018 7:26
2Approved by HOD | Awaiting Store's Approval21022-06-2018 7:2522-06-2018 7:26
3Approved by Store | Awaiting Delivery31022-06-2018 7:2610-07-2018 6:48
4Rejected by Store | Requisition Closed30022-06-2018 7:2706-08-2018 15:02
5Delivered | Requisition Closed31010-07-2018 6:4909-08-2018 8:06
6Rejected by HOD | Requisition Closed20006-08-2018 14:1906-08-2018 14:19
7Auto- approved20025-10-2018 16:3725-10-2018 16:37

hi @PattemManohar

 

sorry the sample of table data is given below

 

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
2221011 59659608-10-2018 11:4008-10-2018 11:40
2231021 59659608-10-2018 11:4708-10-2018 11:47
2241031 41941908-10-2018 12:2508-10-2018 12:25
2251041 41941908-10-2018 12:2708-10-2018 12:27
2261051 31031008-10-2018 14:1508-10-2018 14:15
2271061 31031008-10-2018 14:1508-10-2018 14:15
2281071 31031008-10-2018 14:1608-10-2018 14:16
2291081 31031008-10-2018 14:1608-10-2018 14:16
2301091 31031008-10-2018 14:1708-10-2018 14:17
2311101 31031008-10-2018 14:1708-10-2018 14:17
2321111 31031008-10-2018 14:1808-10-2018 14:18
2331121 31031008-10-2018 14:1908-10-2018 14:19
2341131 31031008-10-2018 14:2008-10-2018 14:20
2351141 25125108-10-2018 15:0008-10-2018 15:00

@PattemManohar

 

or you can refer the final data. its more organized. u can see requisition id is repetitive and i am trying to get only max requisiion_event_id from given requisition_id

 

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

@pprakashI am bit confused. Can you post some example how do you want to see the data. I know, you have mentioned in first post. But, it will be great if you post example with the last posted data.

@rocky09 HI

 

my main table is 

d,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 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 IDCount of requisition_id
135
232
314
4129
5229
617
7117

 

Hi @pprakash

From you information, MaxID should be the max requisition_event_id per requisition_idCount of requisition_id should be the count of requisition_id per MaxID, right?

 

in my test, [Measure] is the  MaxID, i could also create a calculated column max to replace it, then create another column count for Count of requisition_id.

count = CALCULATE(COUNT(Sheet1[requisition_id,]),ALLEXCEPT(Sheet1,Sheet1[max]))

max = CALCULATE(MAX([requisition_event_id,]),ALLEXCEPT(Sheet1,Sheet1[requisition_id,]))

 

 2.png

Or if you need distintcount, you can use the following formula

distintcount = CALCULATE(DISTINCTCOUNT(Sheet1[requisition_id,]),ALLEXCEPT(Sheet1,Sheet1[max]))

 

Best Regards

Maggie

 

 

 

@v-juanli-msft Hi Maggie, thank you so much.......you made my day. As a new user, this is my first perfect visualization.

still, I don't get. Are you counting requisition_ids against requisition_event_id?

 

 

@rocky09 yes but against maximum reqisition_event id only.

I am not sure if i understand it correctly. Anyway, try to create New Table from Modeling tab and use this DAX. Make sure to replace the table name and column as per your data.

 

summarizedata = SUMMARIZE(Table1,Table1[requisition_event_id,],"Count",COUNT(Table1[requisition_id,]))

@rocky09  hi rocky thanks i get the data like 

 

requisition_event id     count

28                                1896

 

but i need bifurcation according to requisition_event_id like you can see in table that requisition_id is repeated according to event id and i need count of requisition_id wrt count of max event id  

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.