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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
joharabbas
New Member

Need urgent help

Range_Selling_Count =
VAR SelectedDateRange =
    DATESBETWEEN(
        'Calendar'[Date],
        MIN('Calendar'[Date]),
        MAX('Calendar'[Date])
    )
RETURN
CALCULATE(
    DISTINCTCOUNT('Data'[Store Code]),
    FILTER(
        ALL('Data'[Store Code]),
        CALCULATE(
            DISTINCTCOUNT('Data'[SKU NAME NEW]),
            'Data'[SKU NAME NEW] IN {"ED 250 ML", "Sugar Free", "4 Pack"},
            'Calendar'[Date] IN SelectedDateRange
        ) >= 2
    )
) using this measure for the selected month by I need another measure for the same period last month and I have tried so much but cant find a solution please guide me
2 REPLIES 2
joharabbas
New Member

Hi @FreemanZ 

Thanks for replying!

 

RS SPLM =
VAR SelectedDateRange =
    DATESBETWEEN(
        'Calendar'[Date],
        EDATE(MIN('Calendar'[Date]), -1),
        EDATE(MAX('Calendar'[Date]), -1)
    )
RETURN
CALCULATE(
    DISTINCTCOUNT('Data'[Store Code]),
    FILTER(
        ALL('Data'[Store Code]),
        CALCULATE(
            DISTINCTCOUNT('Data'[SKU NAME NEW]),
            'Data'[SKU NAME NEW] IN {"ED 250 ML", "Sugar Free", "4 Pack"},
            'Calendar'[Date] IN SelectedDateRange
        ) >= 2
    )
) its working but not giving the correct results actually Im switching between months by a month filter.
FreemanZ
Super User
Super User

Hi @joharabbas ,

 

try like:

 

Range_Selling_Count =
VAR SelectedDateRange =
    DATESBETWEEN(
        'Calendar'[Date],
        EDATE(MIN('Calendar'[Date]), -1),
        EDATE(MAX('Calendar'[Date]), -1)
    )
RETURN
CALCULATE(
    DISTINCTCOUNT('Data'[Store Code]),
    FILTER(
        ALL('Data'[Store Code]),
        CALCULATE(
            DISTINCTCOUNT('Data'[SKU NAME NEW]),
            'Data'[SKU NAME NEW] IN {"ED 250 ML""Sugar Free""4 Pack"},
            'Calendar'[Date] IN SelectedDateRange
        ) >= 2
    )

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.