Forum Discussion

sman's avatar
sman
Frequent Visitor
3 years ago

Creating side-by-side view of table data given two dates

Hello!

 

Given a table like this 

valid_fromvalid_toarticleprice
2022-01-052022-01-15A200
2022-01-162022-03-17A300
2022-03-18 A350
2022-01-082022-01-15B30
2022-01-162022-03-23B40
2022-03-14 B35

 

 

 

I want to create a visualization which let's the user select two dates t_1 and t_2 and display the active prices next to each other. So for example if the user select t_1 = '2022-02-01' and t_2 = '2022-04-01' then the resulting table should be displayed:

articlet1_valid_fromt1_valid_tot1_pricet2_valid_fromt2_valid_tot2_price
A2022-01-162022-03-173002022-03-18 350
B2022-01-162022-03-23402022-03-14 35

 

 

 

I've played around with this problem in PowerBI and the closest I've gotten is creating two slicers (one of type above and one of type below) and then classifying rows in the original table as either being irrelevant, matching t1 or matching t2. But that's about it. Does anyone know any other way in which I should approach this problem?

4 Replies