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

Shorten a table (remove rows) as of condition (1st blank cell)

Dear,

 

I have a table "TRUNCATED 2024" and I want to shorten the table as soon as the 1st empty cell begins

 

Yazid_0-1718137358204.png

 

Thanks in advance for your support

1 ACCEPTED SOLUTION
v-kaiyue-msft
Community Support
Community Support

Hi @Yazid ,

 

1. Based on your description, I created some data and wrote a calculated column.

Column =
VAR _current_year = YEAR(TODAY())
RETURN
SWITCH(TRUE(),
'Table'[date].[Year] = _current_year,'Table'[date],
BLANK())

vkaiyuemsft_0-1718156687274.png


2. Create the calculation table.

table2 = FILTER(
'Table',
NOT(ISBLANK('Table'[Column]))
)

vkaiyuemsft_1-1718156877980.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

3 REPLIES 3
v-kaiyue-msft
Community Support
Community Support

Hi @Yazid ,

 

1. Based on your description, I created some data and wrote a calculated column.

Column =
VAR _current_year = YEAR(TODAY())
RETURN
SWITCH(TRUE(),
'Table'[date].[Year] = _current_year,'Table'[date],
BLANK())

vkaiyuemsft_0-1718156687274.png


2. Create the calculation table.

table2 = FILTER(
'Table',
NOT(ISBLANK('Table'[Column]))
)

vkaiyuemsft_1-1718156877980.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

Thanks a lot !

ExcelMonke
Super User
Super User

You can filter out 0s. But the table will still contain these. Best way to do this is in the Transform data steps. Your DAX won't work here, and you will need to use Power Query M Language





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors