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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
URobert
Frequent Visitor

create one report based on customers valid characteristics between start and end date

Hi,

Please help me with the following issue.

I have a 3 different tables with different informations about the customers but each one has a time slice.

I want to create one table with all the informations based on customer name as an unique ID between tables which will show me on line level each customer with valid characteristic for that period (maybe on daly / month / year split).

Or to have a slicer as a period and to show me all the valid characteristics for each customer (not only one one line per customer) each valid characteristic between selected period.

 

input data table 1

customercontract IDcontat starting datecontract end date
A1201.01.201731.12.2018
A3501.01.201831.12.2020
B201.01.201801.07.2018
C415.04.201910.03.2020
A13501.06.201831.12.2019

 

input data table 2

customercustomer characteristiccontat starting datecontract end date
ALarge01.01.201601.10.2017
AMedium02.10.201701.02.2018
ASmall02.02.201831.12.2019
AMedium01.01.202030.06.2020
AExtra Large01.07.202031.10.2020
BSmall01.01.201801.01.2019
CExtra Large01.01.202031.12.2021
BMedium02.01.201901.06.2020

 

input data table 3

customerinternal/externalcontat starting datecontract end date
AInternal01.01.201601.11.2017
AExternal02.11.201701.02.2018
AInternal01.01.202030.06.2020
AExternal01.07.202031.10.2020
BInternal01.01.201801.01.2019
CInternal01.01.202031.12.2021
BExternal02.01.201901.06.2020

 

result 1 (example only for customer A)

customerstart valid dateend valid datecontract idcustomer characteristicinternal/external
A01.01.201701.10.201712LargeInternal
A02.10.201701.11.201712MediumInternal
A02.11.201731.12.201712MediumExternal
A01.01.201831.01.201835MediumExternal
A01.02.201801.02.201835Medium 
A02.02.201831.12.201935Small 
A01.01.202030.06.202035MediumInternal

 

result 2 (example only for customer A)

customervalid datecontract idcustomer characteristicinternal/external
A01.01.201712LargeInternal
A02.10.201712MediumInternal
A02.11.201712MediumExternal
A01.01.201835MediumExternal
A01.02.201835Medium 
A02.02.201835Small 
A01.01.202035MediumInternal

 

result 3 (example only for customer A)

customeryearcontract idcustomer characteristicinternal/external
A201712LargeInternal
A201712MediumInternal
A201712MediumExternal
A201835MediumExternal
A201835Medium 
A201835Small 
A202035MediumInternal

 

result 4 (example only for customer A)

customerdatecontract idcustomer characteristicinternal/external
A01.01.201712LargeInternal
A02.01.201712LargeInternal
A03.01.201712LargeInternal
A04.01.201712LargeInternal
A……………………
A01.10.201712LargeInternal
A02.10.201712MediumExternal

 

Or other ideas to be able to see customers based on their valid characteristics on a certain date (day / month or year) or for a certain period selected in a slicer.

image.png

Thank you !

4 REPLIES 4
mahoneypat
Employee
Employee

Here is how I would approach this one.

 

1.  Bring in all 3 tables, and disable load (right click each and uncheck Enable Load).  Add a custom column called "Attribute" to each query with the respective type of information ( = "Contract", "Size", "Internal/External").  Also rename the ContractID, Internal/External, and Customer Characteristic columns to "Value".

2.  Append all 3 tables, and call the table "Customer".  This should result in one table with 5 columns and all your customer information.

3.  You can then make a matrix visual with Customer on rows, Attribute on columns, and the measure below in values.

4.  Add a Date table but have no relationship to your customer table.

5.  Add a Date slicer (single date for this example)

6.  Have a measure like

 

Customer Value =
VAR thisdate =
    MIN ( 'Date'[Date] )
RETURN
    CALCULATE (
        MIN ( Customer[Value] ),
        FILTER (
            Customer,
            Customer[StartingDate] <= thisdate
                && Customer[EndingDate] >= thisdate
        )
    )

This should show you the characteristic for each attribute on that date for each customer.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Fowmy
Super User
Super User

@URobert 

You only have Customer as to the common column across tables, how do you relate Customer Large from Table 2 to Table 1? Against which row. Clarify with that logic, please.

________________________

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

I accept KUDOS 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

URobert
Frequent Visitor

Hi,

The result i want to get is a table on customer level, with valid characteristic based on selected date.

If a have a period selected and for one customer i have different characteristics, to have different lines for the same customer.

So the customer name is the unique id to link the tables and maybe i need to create a data table in order to show the valid characteristic from each table and to link it with the customer.

Anonymous
Not applicable

I could be wrong but I don't think it can be done. As you have nothing unique for each row/customer, you're going to experience a lot of duplication each time you merge each data set. 

 

for example, there's no way for it to distinguish that customer ID (12) from "input table 1" related directly to customer characteristic "Large" from input table 2. So you'll get 3 or 4 duplicates with that merge alone. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors