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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
jinivthakkar
Frequent Visitor

Measure between two hardcoded dates

Hi All,

 

I have created a measure which is working fine, please see below measure.

 

Now I need to get measure between 2 specific dates which are 01-Jan-22 and 30-Jun-22. So I am not sure how I can modify existing measure without making changes to my data model/date dim table.

 

Measure1 =
CALCULATE (
    COUNTROWS ( MyTable ),
    FILTER (
        'MyTable',
        'MyTable'[col1] <> "myvalue"
            && MyTable[col2] = "myvalue"
            && MyTable[col3] <> BLANK ()
    ),
    USERELATIONSHIP ( MyTable[Date], DateDim[Date] )
)

 

 

I am confused, if I should you use formulaes like YTD, MTD or I should just add filters for dates and dates of which table (mytable or datedim) ?

 

Please guide.

 

TIA

 

 

 

1 ACCEPTED SOLUTION
FreemanZ
Community Champion
Community Champion

try this:
Measure2 =
CALCUALTE(
    Measure1,
    DateDim[Date] > = DATE(2022,1,1),
    DateDim[Date] < = DATE(2022,6,30)
)

View solution in original post

1 REPLY 1
FreemanZ
Community Champion
Community Champion

try this:
Measure2 =
CALCUALTE(
    Measure1,
    DateDim[Date] > = DATE(2022,1,1),
    DateDim[Date] < = DATE(2022,6,30)
)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.