cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tonyclifton Helper I
Helper I

Aggregate daily input to monthly/yearly report

Hello community,


I have a table with daily information about the licenses users have:

2020-02-21License 1userA
2020-02-21License 2userA
2020-02-20License 1userA
2020-02-20License 2userA
2020-02-21License 1userB
2020-02-20License 1userB

...

In PowerBI I linked the date column with my calendar.

The goal is to select the month or year column from the calendar to give me the count of licenses a user has for that selection.


So, from above example table I would like to see the following results by being able to select the Month or Year column:
a.png

 

 

 

 

 

 

 

 

 

Currently I can only use the date column with this formula but selecting a day is not suitable for a monthly overview:

 

LicensesCount =
CALCULATE (
COUNT(Table[License] );
ALLSELECTED( Table[Date]) )

 

 

I hope you can show me a way how to achieve this.
Thank you very much in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Aggregate daily input to monthly/yearly report

Create a date calendar table.

Month = format(Date[Date],"YYYY-MM")

Year= format(Date[Date],"YYYY")

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

you can use count of a column or countrows(Table)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


View solution in original post

4 REPLIES 4
Super User IV
Super User IV

Re: Aggregate daily input to monthly/yearly report

Create a date calendar table.

Month = format(Date[Date],"YYYY-MM")

Year= format(Date[Date],"YYYY")

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

you can use count of a column or countrows(Table)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


View solution in original post

vivran22 Solution Sage
Solution Sage

Re: Aggregate daily input to monthly/yearly report

Hello @tonyclifton,

 

If you have created additional support columns in your date table and it is linked with your data table, then you will not need any measure to get the required visual:

 

Data 1.PNG

 

Calendar table:

Calendar = 
ADDCOLUMNS (
    CALENDAR ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ) ),
    "Year", YEAR ( [Date] )
)

Month = STARTOFMONTH ('Calendar'[Date] )

 

Relationship:

 

Relationship.png

 

Result:

 

view.PNG

 

Regards,
Vivek

If it helps, please mark it as a solution

Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Baskar Resident Rockstar
Resident Rockstar

Re: Aggregate daily input to monthly/yearly report

Dear Friend, 

 Try this as well,

Action 3.PNGStep 3Step 1.PNGStep 1Step 2.PNGStep 2

 

Here simple DAX is enough : Countrows of table.

 

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

http://powerbi.baskarbiconsultant.com/

Community Support
Community Support

Re: Aggregate daily input to monthly/yearly report

Hi @tonyclifton ,

 

You could use “Split” feature to split date as year, month and day.

Then you could put user column in the field pane and set as count.

2-1.PNG

 

 

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

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors