Forum Discussion
Help Variable date measure
- Georgetimes2 years agoFrequent Visitor
Hi Daniel29195
Sorry, I wasn't clear enough. The issue is that we don't store anywhere this data. We just agree with customers that from period X you'll have a discount of 10% for example.
That's why I need a filter or something like this were the big managers can come, add X dates for "period with discount" and Y dates for period without discount.
I know this can be done with two filters and two tables so I'll get:
table 1
Customer Discount A 2 table 2
Customer without discount A 1 But I don't know how I can store those numbers in order to calculate the difference (2 minus 1) divided by 1
- Daniel291952 years agoCommunity Champion
ok i think i got you .
create a table to store this data as follow : ( example name : Discount_tbl)
let us say , discount 10% between 2023-01-01 and 2023-01-10
then your table would be as follow :
date discount discount_status
2023-01-01 0.1 with discount
2023-01-02 0.1 with discount
2023-01-03 0.1 with discount
2023-01-05 0.1 with discount
.....
2023-01-11 0 without discount
from here, you should have a dimdate which should be linked to this table .
A dimcustomer = distinct(table_name[customer-column]) ( you can use this to create w dimcustomer if you dont have it in your model ) .
and your table :
Customer | Booking Date | Booking Reference
A 01/01/2024 ABC1
A 02/01/2024 DDD1
A 7/01/2024 4567
B 10/02/2024 CDB2
from here, you can create a calculated column in your table :
discount_status = related ( discount_table[discount_status])
now you can drag and drop your columns into the visual and it will show what you want .If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos 👍🫡
- Georgetimes2 years agoFrequent Visitor
Hi Daniel29195
Thanks for your answer, however I'm afraid this doesn't quite help me.
The reason why I'm stuck it's because of those discount dates. I can't have another table that says "discount" "not discount" because I need this to be fully variable.
The customer will want now to see discount date between 01/01/2023 - 15/03/2023 and 1 minute after he sees the numbers he'll want to check another discount period of 23/03/2023 - 27/03/2023 for example.
Those discount and not discount dates are not "fixed dates" for one report. Hope it makes sense.