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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sohan
Helper III
Helper III

Visual not displaying data when using month as X-axis

I have the following DAX measure: 

Rolling AVG NPs = 

var periodCalculation = -3

var result =
CALCULATE([A],
          DATESINPERIOD(DimCalendar[Date],
                        LASTDATE(DimCalendar[Date]), periodCalculation, Month
                       )
         )

var finalResult = 
result /
CALCULATE(DISTINCTCOUNT(DimCalendar[Year/Month]),
          DATESINPERIOD(DimCalendar[Date],
                        LASTDATE(DimCalendar[Date]), periodCalculation, Month
                       )
         )

RETURN finalResult

 

When I visualize this measure with DimCalendar[Year/Month], the data is displayed. When I visualize it with DimCalendar[Month], the visual is empty. Does anyone know how I can fix this?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Sohan , if you do not have a slicer/filter on the page. the last date will take a month to the last available month in date table, which might not have data.

 

Seem like very similar to

Why DATESMTD is still blank, even after having correct TI Setup: https://youtu.be/j0ug-XQgZtg

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Sohan , if you do not have a slicer/filter on the page. the last date will take a month to the last available month in date table, which might not have data.

 

Seem like very similar to

Why DATESMTD is still blank, even after having correct TI Setup: https://youtu.be/j0ug-XQgZtg

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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