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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
AxolotlIncognit
Frequent Visitor

How to show value for all months between begin and end date

Hi all'ya.

 

Data comes in as follows:
Project name, beginning date for billing, end date  for billing, total sum and monthly revenue. Each of these is their own field. How do I show on the report that, e.g. billing that started March and ended in May shows values for all these three months?

Can I do this in DAX or should I spread dates in query? And if the latter what do I do with nulls? I quess I could just insert project start date as value for nulls.
3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @AxolotlIncognit ,

 

I suggest you to create an unrelated calendar table and add a measure to filter the visual.

Data model:

vrzhoumsft_0-1695886221436.png

Measure:

 

Filter = 
VAR _RANGESTART =
    MIN ( 'Calendar'[Date] )
VAR _RANGEEND =
    MAX ( 'Calendar'[Date] )
RETURN
    IF (
        MAX ( 'Table'[beginning date for billing] ) >= _RANGESTART
            && MAX ( 'Table'[end date for billing] ) <= _RANGEEND,
        1,
        0
    )

 

Add this measure into visual level filter and set it to show items when value =1.

vrzhoumsft_1-1695886262425.png

 

Best Regards,
Rico Zhou

 

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

 

Problem is, I want to show the months between - not just amount of months or the first and the last. But I want to list all the months between.

Yes, thank you so much. I'll look at this with more thought tomorrow.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.