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.
Dear all,
Considering i have 3 fact tables, each with different date, but similar structure
Claim ID | Underwriting Date | Loss Incurred |
1 | 201801 | 1000 |
2 | 201802 | 200 |
3 | 201803 | 5000 |
Claim ID | Accident Date | Loss Incurred |
1 | 201802 | 1000 |
2 | 201803 | 200 |
3 | 201804 | 5000 |
Claim ID | Calendar Date | Loss Incurred |
1 | 201803 | 1000 |
2 | 201803 | 200 |
3 | 201804 | 5000 |
I am using direct query to database to retrieve this data.
I would like to have a filter that specifies which date view (calander, underwriting, loss). Once i click on the filter, the loss incurred or any other relevant field will reflect accordingly.
Any suggestion besides of union the 3 tables and create the type?
Regards
CS
Solved! Go to Solution.
Create a new table with the union of all and unpivot the Date column in a hack-ish way
Claims =
UNION(
SELECTCOLUMNS(ClaimTbl_1, "Claim ID", ClaimTbl_1[Claim ID], "Date", "Underwriting Date", "Loss Incurred", ClaimTbl_1[Loss Incurred]),
SELECTCOLUMNS(ClaimTbl_2, "Claim ID", ClaimTbl_2[Claim ID], "Date", "Accident Date", "Loss Incurred", ClaimTbl_2[Loss Incurred]),
SELECTCOLUMNS(ClaimTbl_3, "Claim ID", ClaimTbl_3[Claim ID], "Date", "Calendar Date", "Loss Incurred", ClaimTbl_3[Loss Incurred])
)
Original solution found here:
https://stackoverflow.com/questions/50213905/is-it-possible-to-unpivot-in-power-bi-using-dax
Create a new table with the union of all and unpivot the Date column in a hack-ish way
Claims =
UNION(
SELECTCOLUMNS(ClaimTbl_1, "Claim ID", ClaimTbl_1[Claim ID], "Date", "Underwriting Date", "Loss Incurred", ClaimTbl_1[Loss Incurred]),
SELECTCOLUMNS(ClaimTbl_2, "Claim ID", ClaimTbl_2[Claim ID], "Date", "Accident Date", "Loss Incurred", ClaimTbl_2[Loss Incurred]),
SELECTCOLUMNS(ClaimTbl_3, "Claim ID", ClaimTbl_3[Claim ID], "Date", "Calendar Date", "Loss Incurred", ClaimTbl_3[Loss Incurred])
)
Original solution found here:
https://stackoverflow.com/questions/50213905/is-it-possible-to-unpivot-in-power-bi-using-dax
Better you change all date field name as a date after that merge all table into one new table. because of all tables having same fields.
I am using direct query, so union cant work unless import?
Thats why asking if there is any other way to do it.
Also, i want a 2 filters, 1 filter to show date range, another filter to differentiate the type(calender view, underwriting view, loss view).
Do you have a Date table linking the 3 fact tables up? I would have thought using that Date table as your filter should flow to the other tables.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |