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

Calculated colum

Hi all,

 

I have a question for this DB:

https://www.dropbox.com/s/m8hywr41rn6neq8/example.xlsx?dl=0

 

I wold have a table:

- grouped by Rimorchio: a list of all the contents

- Grouped by Trasportatore

- 3 fileds: Check in, check out, tot

1) checkin= the tot of the nr of Checkin from the field "senza titolo", for each index of "Rimorchio"

2) checkout = the tot of the nr of Checkout from the field "senza titolo", for each index of "Rimorchio"

3) tot= the difference between checkout and checkin

 

Do u have any idea to solve it?

Thanks for your help

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

Hope I understood your request correctly.

create a table

Table = ADDCOLUMNS( SUMMARIZE('Foglio1','Foglio1'[RIMORCHIO],"checkin",CALCULATE(countrows(Foglio1),FILTER('Foglio1',Foglio1[Senza Titolo]="CHECKIN")),"checkout",CALCULATE(countrows(Foglio1),FILTER('Foglio1',Foglio1[Senza Titolo]="CHECKOUT"))),"tot",[checkout]-[checkin])

1.PNG





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@Anonymous 

Hope I understood your request correctly.

create a table

Table = ADDCOLUMNS( SUMMARIZE('Foglio1','Foglio1'[RIMORCHIO],"checkin",CALCULATE(countrows(Foglio1),FILTER('Foglio1',Foglio1[Senza Titolo]="CHECKIN")),"checkout",CALCULATE(countrows(Foglio1),FILTER('Foglio1',Foglio1[Senza Titolo]="CHECKOUT"))),"tot",[checkout]-[checkin])

1.PNG





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

Proud to be a Super User!




Anonymous
Not applicable

Hi Ryan

 

it works!

thanks a lot

a last question:

how can I had a column to have the greater date relative at the check in?

@Anonymous 

do you want to add the latest checkin date to the new table?

Table = ADDCOLUMNS( SUMMARIZE('Foglio1','Foglio1'[RIMORCHIO],"checkin",CALCULATE(countrows(Foglio1),FILTER('Foglio1',Foglio1[Senza Titolo]="CHECKIN")),"checkout",CALCULATE(countrows(Foglio1),FILTER('Foglio1',Foglio1[Senza Titolo]="CHECKOUT")),"maxcheckindate",CALCULATE(max('Foglio1'[Data della registrazione]),ALLEXCEPT('Foglio1',Foglio1[RIMORCHIO]))),"tot",[checkout]-[checkin])

 1.PNG





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

Proud to be a Super User!




VijayP
Super User
Super User

@Anonymous 

If I have understood your question , please let me know do you want this information shown in the belwo pic?

Vijay Perepa

 

2020-08-16_211401.png




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


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.

Top Solution Authors