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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Getting Active Records with respect to calendar date having no relation to the Calendar table.

There are 4 tables i.e calender,customer,pricelistheader,pricelistdetail.

pricelistheader table is linked to customer table i.e one customer will have one pricelist and then one pricelist will have multiple details in the pricelistdetail table(nothing but multiple SKU's). on top this for each sku there might be multiple records in the line item out of which one will be active at a given point of time according to start_date and end_date.

 

for more clarification let's see the below query

select * from pricelistdetail where product id = 'xvsdf' and pricelistid = 'cvnjd'

lets suppouse there are 3 entries for above query

id               product id       pricelist id       Start_date         End_date       Tax-1     Tax-2 
1001            xvsdf                cvnjd           30-08-2019       25-12-2020      250        59
1002           xvsdf                 cvnjd           26-12-2020       15-09-2021      225        18
100             xvsdf                 cvnjd           16-09-2021       30-12-2022     110        22

 

out of 3 entries only one current active record should be taken. if we directly take any attribute or column from the pricelistdetail table it is fetching all records instead of current record.

Note : There is no relationship between the calender table and pricelist table.

 

Our Requirement is for the respective calender date, for the respective sku, for the respective customer what will be the pricelist detaile active record. (i.e Tax-1 and Tax-2 should return only active record should not fetch all the records)

customer Number       sku          Tax-1        Tax-2

     12311                 productA      123          220

     12322                 productB      124          222

     12333                 productC      125          224

 

Please help me to write dax for getting active Records for Tax-1 and Tax-2 from the pricelistdetailed table.

 

 

Thank You.

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

Could you share some snapshots so we have a clearer picture of what you are trying to do, and it would be nice to have a sample file.

 

As a general advise, please, provide:

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar
  2. Expected output from sample data
  3. Explanation in words of how to get from 1. to 2.

 

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

 

Best Regards,
Community Support Team _ Zeon Zheng

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

TomMartens
Super User
Super User

Hey @Anonymous ,

 

please take the time to create a Power BI Desktop file (the pbix file) that contains sample data, but reflects your data model (tables, relationships between tables, calculated columns, and measures that might affect the expected result). Upload the pbix file to onedrive or dropbox and share the link. If you are using Excel to create the sample data, instead of using the manual input method, share the xlsx as well.

Describe the expected output based on the sample data you are using.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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