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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Prabha45
Helper III
Helper III

Need to show values till selected month

I had a year, month slicer. I need to show values(Measure) till the selected month in a matrix. If April 2022 is selected, the matrix should show values from 2022 Jan to April in the matrix.

Measure =
IF (HASONEVALUE ( Data[Category] ),
IF (
SELECTEDVALUE ( Data[Category] ) IN { "Phones", "Watches", "Shoes" },
AVERAGE ( Data[value] ),
SUM ( Data[value] )
))

5 REPLIES 5
Prabha45
Helper III
Helper III

Hi
Month name - Text(data type )
Rows - category
Columns - Month name, site
Values - Measure

FreemanZ
Super User
Super User

hi @Prabha45

 try like:

Measure =
IF (
    HASONEVALUE ( Data[Category] ),
    IF (
        SELECTEDVALUE ( Data[Category] ) IN { "Phones", "Watches", "Shoes" },
        AVERAGEX ( 
            FILTER(ALL(Data[Date]), Data[Date]<=SELECTEDVALUE (Data[Date])), 
            Data[value] 
        ),
        SUMX ( 
            FILTER(ALL(Data[Date]), Data[Date]<=SELECTEDVALUE (Data[Date])), 
            Data[value] 
        )
    )
)

 

this is supposed to work with a date column. 

 

Thanks. but, I don't have a date column. Only year,quarter,month are available.

hi @Prabha45 

month in which format? month name or month number?

what rows and columns do you have the mentioned matrix?

Hi
Month name - Text( datatype)
Rows - Category
Columns - Month, Site
Values - Measure

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.