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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
ACol123
Helper I
Helper I

Help with a clustered column chart

Hi everyone.

I'm working on a clustered column chart. I need the columns to be non-dynamic.

Let me explain better: I want when my function is = 0 or is blank to not hide the column but to return me a result equal to "-".

 

Could there be a problem with my function?

TEST =

VAR SelectedMonth = SELECTEDVALUE(PERIODSELECT[Month Period PS], MAX(PERIODSELECT[00 Month Period PS]))

VAR SelectedYear = SELECTEDVALUE(PERIODSELECT[Year Period PS], MAX(PERIODSELECT[00 Year Period PS])) RETURN CALCULATE( SUM(DB[Column1]),

DB[Column2] = "Internal",

DB[Column3] = "External",

ALL(PERIODSELECT),

DB[Year Period] = SelectedYear, DB[Month Period] <= SelectedMonth). 

 

E.g. I have a column with 4 columns and a filter on the months of the year. The four columns of the table are a,b,c,d. When I filter for February the columns "b" and "d" disappear because they have no values. I need them not to disappear and to give me back "-". How can I do it?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ACol123 ,

Please have a try.

TEST =
VAR SelectedMonth =
    SELECTEDVALUE (
        PERIODSELECT[Month Period PS],
        MAX ( PERIODSELECT[00 Month Period PS] )
    )
VAR SelectedYear =
    SELECTEDVALUE (
        PERIODSELECT[Year Period PS],
        MAX ( PERIODSELECT[00 Year Period PS] )
    )
VAR Result =
    CALCULATE (
        SUM ( DB[Column1] ),
        DB[Column2] = "Internal",
        DB[Column3] = "External",
        ALL ( PERIODSELECT ),
        DB[Year Period] = SelectedYear,
        DB[Month Period] <= SelectedMonth
    )
RETURN
    IF ( ISBLANK ( Result ) || Result = 0, "-", Result )

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

Hi @ACol123 ,

Please have a try.

TEST =
VAR SelectedMonth =
    SELECTEDVALUE (
        PERIODSELECT[Month Period PS],
        MAX ( PERIODSELECT[00 Month Period PS] )
    )
VAR SelectedYear =
    SELECTEDVALUE (
        PERIODSELECT[Year Period PS],
        MAX ( PERIODSELECT[00 Year Period PS] )
    )
VAR Result =
    CALCULATE (
        SUM ( DB[Column1] ),
        DB[Column2] = "Internal",
        DB[Column3] = "External",
        ALL ( PERIODSELECT ),
        DB[Year Period] = SelectedYear,
        DB[Month Period] <= SelectedMonth
    )
RETURN
    IF ( ISBLANK ( Result ) || Result = 0, "-", Result )

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

 

 

Thejeswar
Super User
Super User

Hi @ACol123 ,

Did you try something like

 

b = if(NOT(ISBLANK([Measure])), [Measure], "-")

Yes, but the graph continues to hide the columns:PBIRisp.png

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors