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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Dynamically update column values based on maximum slicer Date

Hi everyone

I have the following task, which i am pulling my hairs for several hours

Attached is the PBIX File

 

I have requirement to display data in Matrix and update "Opening Balance" calculated Column based on following rules

 

  1. If max slicer date is greater than Acquisition date, than "Opening balance" = sum (Acquisition Price + Acquisitions added – Depreciations Added – Write downs)
  2. But if max slicer date is same as acquisition date, "Opending balance" = only (Acquistion price)
  3. Hide rows if acquisition date is greate than the slicer date range

 

I tried multiple solutions jumping between measures/Columns, but seems powerbi may not be the right tool to do some of these dynamic stuff?

 

 

will appreciate if you can help 🙂

 

Thank you

-Usman

 

Download Sample PBIX File here

 

FA1.PNGFA2.PNG

 

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,


I have requirement to display data in Matrix and update "Opening Balance" calculated Column based on following rules

 

  1. If max slicer date is greater than Acquisition date, than "Opening balance" = sum (Acquisition Price + Acquisitions added – Depreciations Added – Write downs)
  2. But if max slicer date is same as acquisition date, "Opending balance" = only (Acquistion price)
  3. Hide rows if acquisition date is greate than the slicer date range

 

From your pbix, it seems that you create the calculated column for Opening Balance, you'd better create the measure which is dynamic.

 

You could try the measure below based on your logic.

 

Measure =
VAR a =
    CALCULATE ( MAX ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )
VAR b =
    MAX ( 'Query1'[ACQUISITIONDATE] )
RETURN
    IF (
        a = b,
        SUM ( 'Query1'[ACQUISITIONPRICE] ),
        IF (
            a > b,
            SUM ( 'Query1'[ACQUISITIONPRICE] ) + SUM ( 'Query1'[Acquisition_Add] )
                - SUM ( 'Query1'[Depreciation_Add] )
                - SUM ( 'Query1'[Writedown_Add] )
        )
    )

Here is the output.

 

Untitled.png

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
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-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,


I have requirement to display data in Matrix and update "Opening Balance" calculated Column based on following rules

 

  1. If max slicer date is greater than Acquisition date, than "Opening balance" = sum (Acquisition Price + Acquisitions added – Depreciations Added – Write downs)
  2. But if max slicer date is same as acquisition date, "Opending balance" = only (Acquistion price)
  3. Hide rows if acquisition date is greate than the slicer date range

 

From your pbix, it seems that you create the calculated column for Opening Balance, you'd better create the measure which is dynamic.

 

You could try the measure below based on your logic.

 

Measure =
VAR a =
    CALCULATE ( MAX ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )
VAR b =
    MAX ( 'Query1'[ACQUISITIONDATE] )
RETURN
    IF (
        a = b,
        SUM ( 'Query1'[ACQUISITIONPRICE] ),
        IF (
            a > b,
            SUM ( 'Query1'[ACQUISITIONPRICE] ) + SUM ( 'Query1'[Acquisition_Add] )
                - SUM ( 'Query1'[Depreciation_Add] )
                - SUM ( 'Query1'[Writedown_Add] )
        )
    )

Here is the output.

 

Untitled.png

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Bundle of thanks Cherry

 

A follow up question if ok 🙂

The total of opening balance measure is exceeding Assetts Acquisition price; 

How can we display the Opening balance so that it 

  1. Sums up, and shows only one value, i.e. 13,342.77 - 370.63 - 370.63 - 370.63 = 12,972.14; rather than increasing a fixed assett's value for each row...
  2. & still shows the acquisitions/depreciations rows...

 

Click here for Here is the update file.pbix

 

thank you againFA3.PNG

 

 

Hi @Anonymous ,

 

It seems that you have another requirement.

 

You'd better create another topic so that if your question has been answered people who may have the same question can get the solution directly.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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