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
anusha_madhavan
Frequent Visitor

How to display previous data for null values in column charts?

Sent by you:
I have few measures from a table which are enabled repos, not enabled repos in power bi and I have calender date column as well. Now, I have stacked column chart that displays these values.The measures are in y axis and calender date in x axis and I consider MonthInCalenderShort. For certain months, there is no value for enabled repos and not enabled repos. In such scenarios, I would like to display the count of enabled and not enabled repos of the previous month. How to do that?
anusha_madhavan_0-1727339400323.png

 

I have already tried using carryforward and nonblank scenarios.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @anusha_madhavan 

Based on your information, I create a sample table:

vyohuamsft_0-1727420393854.png

 

Then create new measures, try the following DAX:

LastNonBlankEnabledRepos = 
CALCULATE(
    LASTNONBLANK('Table'[EnabledRepos], CALCULATE(SUM('Table'[EnabledRepos]))),
    FILTER(
        ALL('Table'),
        'Table'[CalendarDate] <= MAX('Table'[CalendarDate])
    )
)
LastNonBlankNotEnabledRepos = 
CALCULATE(
    LASTNONBLANK('Table'[NotEnabledRepos], CALCULATE(SUM('Table'[NotEnabledRepos]))),
    FILTER(
        ALL('Table'),
        'Table'[CalendarDate] <= MAX('Table'[CalendarDate])
    )
)

 

Here is my preview:

vyohuamsft_1-1727421165414.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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
Anonymous
Not applicable

Hi, @anusha_madhavan 

Based on your information, I create a sample table:

vyohuamsft_0-1727420393854.png

 

Then create new measures, try the following DAX:

LastNonBlankEnabledRepos = 
CALCULATE(
    LASTNONBLANK('Table'[EnabledRepos], CALCULATE(SUM('Table'[EnabledRepos]))),
    FILTER(
        ALL('Table'),
        'Table'[CalendarDate] <= MAX('Table'[CalendarDate])
    )
)
LastNonBlankNotEnabledRepos = 
CALCULATE(
    LASTNONBLANK('Table'[NotEnabledRepos], CALCULATE(SUM('Table'[NotEnabledRepos]))),
    FILTER(
        ALL('Table'),
        'Table'[CalendarDate] <= MAX('Table'[CalendarDate])
    )
)

 

Here is my preview:

vyohuamsft_1-1727421165414.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ritaf1983
Super User
Super User

Hi @anusha_madhavan 
Please refer to the linked video:
https://www.youtube.com/watch?v=qo_omRxgLSY

If my answer was helpful please give me a Kudos and accept as a Solution.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.

Top Solution Authors
Top Kudoed Authors