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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
awff
Helper III
Helper III

Use last known value if no data in show items with no data.

Happy new years!

 

The below visual is simply the number of users in a period with the line showing the total licenses at the time. This visual has "Show items with no data" turned on because we also want to see days where there were no sessions.

 

My request is that I want the Total licenses to be continuous and use the last value even if no data exists until the next update. So ideally, there should be no breaks in the line graph where there are no check-outs. I've tried LASTNONBLANKVALUE with no luck unfortunately!

 

awff_1-1704777773882.png

 

Total licenses is a measure as below:

 

 

TotalLicenses = 
CALCULATE(
    SUM('2_ProductLog_df'[TotalLicenses]),
    FILTER(
        '2_ProductLog_df',
        '2_ProductLog_df'[CompanyAbbrev] = '1_SessionLogs_py'[CompanyAbbrev] &&
        '2_ProductLog_df'[SessionStart] <= '1_SessionLogs_py'[SessionStart] &&
        '2_ProductLog_df'[SessionNextUpdate] >= '1_SessionLogs_py'[SessionStart]
    )
)

 

 

 

Any tips is appreciated! 

 

1 ACCEPTED SOLUTION

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1704940885759.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Here is a simplified sample data:

Sessions:

SessionStartTotalLicenses
9-Jan-234
9-Jan-234
9-Jan-234
10-Jan-234
11-Jan-236
11-Jan-236
11-Jan-236
11-Jan-236
11-Jan-236
12-Jan-236
12-Jan-236
16-Jan-234
20-Jan-235
29-Jan-239
31-Jan-235
5-Feb-235
20-Feb-239
4-May-234

 

The desired result is where the TotalLicenses will use the previous non-blank value for dates with no data in the session table. If this could be done in a measure, it would be great as the dataset is quite large...

 

DateDesired Result
1-Jan-23 
2-Jan-23 
3-Jan-23 
4-Jan-23 
5-Jan-23 
6-Jan-23 
7-Jan-23 
8-Jan-23 
9-Jan-234
10-Jan-234
11-Jan-236
12-Jan-236
13-Jan-236
14-Jan-236
15-Jan-236
16-Jan-234
17-Jan-234
18-Jan-234
19-Jan-234
20-Jan-235
21-Jan-235
22-Jan-235
23-Jan-235
24-Jan-235
25-Jan-235
26-Jan-235
27-Jan-235
28-Jan-235
29-Jan-239
30-Jan-239
31-Jan-235

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1704940885759.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ritaf1983
Super User
Super User

Hi @awff 

Please refer to the linked discussion :

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fill-in-blanks-with-last-non-blank-v...

If it doesn't help

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

 

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

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

Thanks,

 

The solution in the post looks promising, but didn't quite resolve the issue, unfortunately. My data does not have a continuous date range for each session.

 

Here is a link to a sample dataset

https://www.icloud.com/iclouddrive/0a6GBQSFt2BfWgj022bYjCPsA#sampleData

 

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors