cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Create date Parameter (asat date) to get active customers

Hi,

 

I'm new to PowerBi. I have got the total count of customers and now trying to create a date Parameter to show active customers asat date. In SQL and Tableau I'm able to achieve this using the below where [Date] is my Parameter

 

[Start Date] <= [Date] AND IFNULL([End Date],[Date]) >= [Date]

 

How can I achive the same in PowerBI?

 

Thanks

Jag

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

@jsbi81,

 

You may refer to the following measure.

Measure =
VAR d =
    SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
    COUNTROWS (
        FILTER (
            Table1,
            Table1[Start Date] <= d
                && (
                    ISBLANK ( Table1[End Date] )
                        || Table1[End Date] > d
                )
        )
    )
Community Support Team _ Sam Zha
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

2 REPLIES 2
Super User IV
Super User IV

Without sample data, something like this should work:

 

MyCount = CALCULATE(COUNTROWS(table),FILTER(table,[Start Date]<=[Date] && [End Date] >= [Date]))

---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Community Support
Community Support

@jsbi81,

 

You may refer to the following measure.

Measure =
VAR d =
    SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
    COUNTROWS (
        FILTER (
            Table1,
            Table1[Start Date] <= d
                && (
                    ISBLANK ( Table1[End Date] )
                        || Table1[End Date] > d
                )
        )
    )
Community Support Team _ Sam Zha
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

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors