Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi,
I have two tables as part of a data model - one called 'pbi TablePriceDiscStaging' and another called 'SalesOrderLineV2Staging'. These two tables are linked via a field called 'AccountItemUnit.'
On the pbi TablePriceDiscStaging table, there are fields for FROMDATE and TODATE. These fields represent the active time that a Pricing Agreement is valid. I need to pull the 'AMOUNT' field from the pbi TablePriceDiscStaging table when the ORDERCREATIONDATETIME field (formatted as date) from the SalesOrderLineV2Staging table falls within the dates between FROMDATE and TODATE fields. Is this possible? If so, is there DAX that will work to accomplish this?
I have already attempted making the transformation in the Query Editor to make a list of dates between the FROMDATE/TODATE fields, and the program crashes each time.
Thanks in advance!
Solved! Go to Solution.
@Anonymous
You could try this measure:
Amount in Pricing Agreement Dates =
CALCULATE (
SUM('pbi TablePriceDiscStaging'[Amount]),
FILTER (
'pbi TablePriceDiscStaging',
'pbi TablePriceDiscStaging'[FROMDATE] <= MIN ( SalesOrderLineV2Staging[ORDERCREATIONDATETIME] )
&& 'pbi TablePriceDiscStaging'[TODATE] > MAX ( SalesOrderLineV2Staging[ORDERCREATIONDATETIME] )
)
)
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
@Anonymous
You could try this measure:
Amount in Pricing Agreement Dates =
CALCULATE (
SUM('pbi TablePriceDiscStaging'[Amount]),
FILTER (
'pbi TablePriceDiscStaging',
'pbi TablePriceDiscStaging'[FROMDATE] <= MIN ( SalesOrderLineV2Staging[ORDERCREATIONDATETIME] )
&& 'pbi TablePriceDiscStaging'[TODATE] > MAX ( SalesOrderLineV2Staging[ORDERCREATIONDATETIME] )
)
)
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
79 | |
65 | |
51 | |
30 |
User | Count |
---|---|
115 | |
115 | |
70 | |
66 | |
39 |