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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
v-yohua-msft
Community Support
Community Support

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
v-yohua-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.