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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
nvmtrang
Frequent Visitor

Power BI and Data warehouse

Hi, we have some back dated transactions where business users modify sale amounts. In power bi, they want to see latest records when they select current month. But the tricky thing is when they select past months, old records get displayed. Just want to know how to design data warehouse properly or write some DAX in PBI to meet their requirement? 

nvmtrang_1-1680754571326.png

 

DWH: a fact table, monthly etl and data loading is append. So, in Jul, biz user modifies Mar record. In sep, biz user again modifies Mar and Apr records. 

in PBI, if current month is Mar, PBI displays all 3 records (up to current month), with Mar record : 100

if current month is Jul, PBI displays all 7 records, with Mar record: 150 (latest up to Jul). BUT when user selects Mar, PBI displays all 3 records, with Mar record: 100

If current month is Sep, PBI displays all 9 records, with Mar record: 250 (latest up to Sep), Apr: 250 (latest up to Sep). BUT when user selects Mar, PBI displays all 3 records, with Mar record: 100. When user select Apr, PBI displays all 4 records, with Mar record: 150 (latest up to Apr), Apr record: 200.

 

2 ACCEPTED SOLUTIONS
nvmtrang
Frequent Visitor

can anyone help? really appreaciate your help on this 😁

View solution in original post

v-zhangti
Community Support
Community Support

Hi, @nvmtrang 

 

You can try the following methods.

Sample data:

vzhangti_0-1681269878340.pngvzhangti_1-1681269895642.png

Measure = 
VAR _Sum =
    CALCULATE ( SUM ( 'Table'[Sales Amount] ),
        FILTER ( ALL ( 'Table' ),
            [Etl Month] = SELECTEDVALUE ( Slicer[Slicer Month] )
                && [Sales Month] = SELECTEDVALUE ( 'Table'[Sales Month] ) ) )
VAR _N1 =
    IF ( _Sum = BLANK (), MIN ( 'Table'[Sales Amount] ), _Sum )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[Sales Month] ) <= SELECTEDVALUE ( Slicer[Slicer Month] ),
        _N1,
        BLANK ()
    )

vzhangti_2-1681269970857.png

vzhangti_3-1681270008910.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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-zhangti
Community Support
Community Support

Hi, @nvmtrang 

 

You can try the following methods.

Sample data:

vzhangti_0-1681269878340.pngvzhangti_1-1681269895642.png

Measure = 
VAR _Sum =
    CALCULATE ( SUM ( 'Table'[Sales Amount] ),
        FILTER ( ALL ( 'Table' ),
            [Etl Month] = SELECTEDVALUE ( Slicer[Slicer Month] )
                && [Sales Month] = SELECTEDVALUE ( 'Table'[Sales Month] ) ) )
VAR _N1 =
    IF ( _Sum = BLANK (), MIN ( 'Table'[Sales Amount] ), _Sum )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[Sales Month] ) <= SELECTEDVALUE ( Slicer[Slicer Month] ),
        _N1,
        BLANK ()
    )

vzhangti_2-1681269970857.png

vzhangti_3-1681270008910.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

 

@v-zhangti thanks so much. It worked like a charm 😍

nvmtrang
Frequent Visitor

can anyone help? really appreaciate your help on this 😁

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.