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

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
amitchandak
Super User
Super User

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

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

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.
Baskar
Resident Rockstar
Resident Rockstar

Dear Friend, 

 Try this as well,

Step 3Step 3Step 1Step 1Step 2Step 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/

vivran22
Community Champion
Community Champion

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/

amitchandak
Super User
Super User

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

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.