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
cosminc
Post Partisan
Post Partisan

Number of days of each months

Hi,

i have a calendar 1 jan 2017 till 31 dec 2019 connected with a source which is split by months, but also i created a fake date - as first date of each month-year to make connection with calendar

now i need for a measure to count days in a graph depending of year and months selection

so if i select jan-feb 2019 i need to have 59 (31+28)

if the graph is split by months, i need to have for jan 31 and feb 28

Now count return only 1 for a month, probably due to fake date from source

Thanks,

Cosmin

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @cosminc 

 

You may add the YearMonth column for your calendar table and fake table.Then link them in relationship.Use date hierarchy for date column to expend the graph.

YearMonth = FORMAT('Calendar'[Date],"MMM YYYY")

1.png

Regards,

Cherie

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

View solution in original post

4 REPLIES 4
v-cherch-msft
Employee
Employee

Hi @cosminc 

 

You may add the YearMonth column for your calendar table and fake table.Then link them in relationship.Use date hierarchy for date column to expend the graph.

YearMonth = FORMAT('Calendar'[Date],"MMM YYYY")

1.png

Regards,

Cherie

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

Hi

if i apply your solution there will be many to many relationship; on my base i have thousands of each month-year

Thanks,

Cosmin

Hi @cosminc 

 

You may also delete the fake data table and just use calendar table's YearMonth column as slicer.If it is not your case,please share your sample data which could reproduce your scenario and your desired output.You can upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Regards,

Cherie

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

my question was regarding that it will be a relationship many to many between the 2 bases - calendar and source

is it ok?

thanks,

Cosmin

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.