Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I want to build a DAX formula that can calculate sales between two dates, 1 date is static that is end date, and 1 date is what I will let user pass and the formula should generate the balance as per that date for any given period, currently I am using below but it do not gives me exact results when I compare this to my SAP System, wondring what I have done wrong here.
Solved! Go to Solution.
Hi @Anmolgan ,
Please give a try to below measure:
Measure = CALCULATE ( SUM ( ValueTable[Value] ), FILTER ( ValueTable, ValueTable[Date] >= MIN( PeriodTable[StartDate] ) && ValueTable[Date] <= MAX ( PeriodTable[EndDate] ) ) )
Please give KUDOS for support and also mark this as a solution if it helps you!
Hi @Anmolgan ,
Can you please share some sample data with minimum table structure and expected result for test? it is hard to coding formula without any detail information.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi @Anmolgan ,
Please give a try to below measure:
Measure = CALCULATE ( SUM ( ValueTable[Value] ), FILTER ( ValueTable, ValueTable[Date] >= MIN( PeriodTable[StartDate] ) && ValueTable[Date] <= MAX ( PeriodTable[EndDate] ) ) )
Please give KUDOS for support and also mark this as a solution if it helps you!
Good answer, but would like to know this:
How is ValueTable related to PeriodTable?
User | Count |
---|---|
98 | |
76 | |
75 | |
49 | |
27 |