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
ItSupportElm
Helper III
Helper III

Gather same Date instead to have each row

Hello, 

 

I have one column "DateCreation" and one column "Id" who correspond to the order.

 

But in my column there sometime 2,3 or 4 times de same date , i want to gather them. 

2020-02-18_13h45_20.png I want to have for exemple "17/02/2020" One line for said i have 4 "Id" (orders)

 

Thanks for the futur answer, great day

19 REPLIES 19
v-alq-msft
Community Support
Community Support

Hi, @ItSupportElm 

 

Based on your description, I created data to reproduce your scenario.

b1.png

 

You may create a table visual to display the reuslt and drag two columns from 'Table'. Please make sure the aggregation for id is 'Count'.

b2.png

As a workaround, you may create a measure as follows.

 

CountForDate = 
CALCULATE(
    COUNTROWS(
        FILTER(
            ALLSELECTED('Table'),
            'Table'[DateCreation]=MAX('Table'[DateCreation])
        )
    )
)

 

 

Result:

b3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello thanks for the answer guys.

 

@v-alq-msft  i tried your solution but it didnt work i dont know why : 

 

2020-02-19_08h12_14.png Do you have any idea why ? 

Hi, @ItSupportElm 

 

'CountForDate' is a measure not a calculated column. If possible, please show me your data model. Do mask sensitive data before uploading.

 

Best Regards

Allan

@v-alq-msft So, i figured out why it didnt work because, im in direct query, there is a dax formul to change Date time in Date format ?

 

thanks again

Hi, @ItSupportElm 

 

You can also change the data type of the column in Power Query. It is the easiest way to solve it.

 

Best Regards

Allan

@v-alq-msft 

 

I change the format in power query , but it didnt want to display like i want : 

2020-02-19_16h03_41.png

there is formul dax that i can use to change the format of the datetime in date ? please 

Hi,

Write the following calculated column formula to extract Date from a Date/time column

=INT(Data[Date_time])

Format this column as Date.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi, @ItSupportElm 

 

Have you tried my last second reply?  You may create a calculated column and a measure as follows.

calculated column:
DateCreation2 = CatalogueInteractifCommande[DateCreation].[Date]

measure:
CountForDate = 
CALCULATE(
    COUNTROWS(
        FILTER(
            ALLSELECTED('CatalogueInteractifCommande'),
            'CatalogueInteractifCommande'[DateCreation2]=MAX(CatalogueInteractifCommande[DateCreation2])
        )
    )
)

 

Result:

a1.png

 

Best Regards

Allan

Hello @v-alq-msft ,

 

It work only with imported column not Directquery.

 

@Ashish_Mathur I dont understand how to do it ccan you give an exemple that i can apply with my model please ?

Hi,

Click on the Data tab at the extreme left hand side pane.   Select the table and go to Modelling > New column.  Write the formula.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello @Ashish_Mathur ,

 

I tried like you said, or did it wrong, can you explain me with screenshot pls

Hi,

Share the link from where i can download your PBI file.  Tell me exactly in which table do you want to create another column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I take data from database in Direct Query... if i share the file it will be imported column

Hi, @ItSupportElm 

 

The 'id' column is the unique identifier of the table. So when we choose 'Count' for it, it will be 1. I think the issue is that the original data type for DateCreation in Power Query is datetime even though you have changed it to date. Please try the following steps.

 

You may create a calculated column and a measure as follows.

 

calculated column:
DateCreation2 = CatalogueInteractifCommande[DateCreation].[Date]

measure:
CountForDate = 
CALCULATE(
    COUNTROWS(
        FILTER(
            ALLSELECTED('CatalogueInteractifCommande'),
            'CatalogueInteractifCommande'[DateCreation2]=MAX(CatalogueInteractifCommande[DateCreation2])
        )
    )
)

 

 

Result:

e1.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Pragati11
Super User
Super User

Hi @ItSupportElm ,

 

Check for 2 things:

1. Check that the format of your date column is DATE type not DATETIME type

2. When you move ID column to the visual along with Date column, set Summarisation on ID column to COUNT

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @Pragati11, and @az38 

 

My date column is already in DATE type, then when i followed you second advice it didnt work.

 

I steal have 4 row with the same date ... 

 

Actually i want to count the number of date with the date itself... 

Hi @ItSupportElm ,

 

Can you please put a screenshot against what kind of summarization you did on ID column when moved on visual with DATE column?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @ItSupportElm ,

 

I have tried the similar scenario at my end and I get the correct output as shown below:

 

id.jpg

 

Hope this helps.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

az38
Community Champion
Community Champion

Hi @ItSupportElm 

Click on Id column in the Visializations pane and set "Count" summarizaion as active


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.

Top Solution Authors