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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
hnoriega
Frequent Visitor

Choose period in column matrix

Hi, I have a matrix with information. I want to show the sales depending on what the user wants (month, trimester or year)

 

 

The column of the matrix should change depending on that:

2017-10-19 15_08_05-Cadenas - Power BI Desktop.png

 

 

This is what I actually have but it´s not working (I cannot add as a column in the matrix)

2017-10-19 15_08_25-Cadenas - Power BI Desktop.png

 

ATM =
IF (
ISFILTERED ( Periodo[Valor]) && HASONEVALUE (Periodo[Valor] ),
if(LASTNONBLANK (Periodo[Valor], 0 )="Año",
VALUES(Informe_Cadenas_Final[YearMonth]),
if(LASTNONBLANK (Table1[Valor], 0 )="Trim",
values(Informe_Cadenas_Final[YearMonth])
)
),
VALUES(Informe_Cadenas_Final[Mes])
)

 

 

 

Is there any solution?

 

Thanks!!

1 REPLY 1
Anonymous
Not applicable

Hi @hnoriega,

 

I modified your formula, you can try it if it suitable for your requirement.

ATM =
IF (
    SELECTEDVALUE ( Table1[Valor] ) <> BLANK (),
    LASTNONBLANK(Informe_Cadenas_Final[YearMonth],[YearMonth] ),
    SUM( Informe_Cadenas_Final[Mes] )
)

If above not help, it will be help if you share some sample data for test.

 

Regards,

Xiaoxin Sheng

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