Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.