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
Alde
Frequent Visitor

CLUSTERED STACKED COLUMN CHART + Display the last month of data

Hi Everyone,

I attached the PBI sample file and attached an image for my idea which I reached to shape staged already.

However, I'd like to use the data from 'Col-Type'[CurrentMonth] instead of typing "Mar" as in the provided sample dax because there're a couple dozens of similar measures will be used for different charts, I cannot really manullay update each and every one of them every month, instead It's my desire to just change data in 'Col-Type'[CurrentMonth].

Or Alternatives for my idea are very much appreciated.Screenshot 2022-04-20 at 14.24.59.png

Please help, thank youuuuu <33

https://drive.google.com/file/d/128YEVdMEsiBYfMy-R6J4SowibiA-sXoC/view?usp=sharing

 

OBActual_OB = 
SUMX('Col_Type',
VAR CurrentType = 'Col_Type'[Col_Type]
    Return
            if
            (CurrentType="OB Actual",
            IF  
            (ISFILTERED('ORDER_TABLE'[MONTH])=False(),
            CALCULATE(Sum('obcb'[OB Actual]), 'obcb'[Month] = "mar"),
            FIRSTNONBLANK('obcb'[OB Actual],1)
            )
            )
        )

 

1 ACCEPTED SOLUTION
Alde
Frequent Visitor

Yayy, I got the SOLUTION

 

It didn't work because I put the CurrentMonth column in the same table of the month used to check against, now i created another table without making any relationship and use it in the conditional query. 

 

Screenshot 2022-04-21 at 08.58.12.png

OBActual_OB = 
SUMX('Col_Type',
            if
            ('Col_Type'[Col_Type]="OB Actual",
            IF  
            (ISFILTERED('ORDER_TABLE'[MONTH])=True(),FIRSTNONBLANK('obcb'[OB Actual],1),
            CALCULATE(Sum('obcb'[OB Actual]),'obcb'[Month]= SELECTEDVALUE(lastdatamonth[LastMonth]))
            )
        ))

 

View solution in original post

1 REPLY 1
Alde
Frequent Visitor

Yayy, I got the SOLUTION

 

It didn't work because I put the CurrentMonth column in the same table of the month used to check against, now i created another table without making any relationship and use it in the conditional query. 

 

Screenshot 2022-04-21 at 08.58.12.png

OBActual_OB = 
SUMX('Col_Type',
            if
            ('Col_Type'[Col_Type]="OB Actual",
            IF  
            (ISFILTERED('ORDER_TABLE'[MONTH])=True(),FIRSTNONBLANK('obcb'[OB Actual],1),
            CALCULATE(Sum('obcb'[OB Actual]),'obcb'[Month]= SELECTEDVALUE(lastdatamonth[LastMonth]))
            )
        ))

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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