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
gdps_vc
Helper I
Helper I

Get last Month/Year with no blank values

Hello there!

 

Below I have a part of a KPI database that is loaded in Power BI:

 

VCPRJTypeValueData
VCPRJ0005519Real7329875,3801/04/2023
VCPRJ0009615Plan54582,2423501/04/2023
VCPRJ0005519Plan5291475,4701/04/2023
VCPRJ0009615Real54300,3102101/04/2023
VCPRJ0005519Plan5291475,4701/05/2023
VCPRJ0005519Real5291475,4701/05/2023
VCPRJ0009615Real34536,1389301/05/2023
VCPRJ0009615Plan34536,1389301/05/2023
VCPRJ0005519Real5291475,4701/06/2023
VCPRJ0009615Real 01/06/2023
VCPRJ0005519Plan5291475,4701/06/2023
VCPRJ0009615Plan31576,3943101/06/2023

 

I need to show on a card the last Month/Year that has all values in the Value column filled in (not null/blank), considering only Type = Real.

 

For the example given above, the card should show 05/2023.

 

Any ideas on how to solve this?

1 REPLY 1
rubayatyasmin
Super User
Super User

Hi, @gdps_vc 

 

  1. Create a new calculated column that filters the data to only include rows where Type = Real and the Value is not null or blank.
  2. Create a measure to determine the last month/year that has all values filled in for Type = Real.
  3. Use a card visual to display the result.

example code for the calculated column

 

RealValueFilled = IF(NOT(ISBLANK([Value])) && [Type] = "Real", 1, 0)

 

for measure

 

LastMonthWithAllRealValues =
VAR LastMonthYear =
CALCULATE(
MAX('Table'[Data]),
FILTER('Table', 'Table'[RealValueFilled] = 0)
)
RETURN
EOMONTH(LastMonthYear, -1)

 

this should be enough to give you an idea. 

 

I hope this helps

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.