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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.