The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi guys,
I have following data model:
Table: Contract
ContractID | ValidFrom | ValidTo |
1 | 01/01/2020 | 15/04/2021 |
Table: Rooms
RoomID | ContractID | Amount | ValidFrom | ValidTo |
1 | 1 | 5 | 01/01/2020 | 18/01/2021 |
2 | 1 | 6 | 19/01/2021 | 15/04/2021 |
Table: Cluster
ClusterID | RangeFrom | RangeTo | RangeDesc |
1 | 0 | 2 | Small |
2 | 3 | 5 | Medium |
3 | 6 | 10 | Large |
+ table: Date (standard calendar table)
My fact table is Contract, which has relation to Rooms via ContractID.
What I need to do is following:
- select yyyy-mm on date slicer in PBI (single selection)
- read out selected value - last day of selected month: CALCULATE ( MAX ( Date[Date] ), ALLSELECTED ( Datum ) )
- show all valid Contracts based on date selection (previous step)
- additionally show Amount of rooms based on date selection
- show also RangeDesc from table Cluster based on date selection
Example:
- selected value in date slicer: 2020-12
- contract valid = Yes
- Amount of rooms: 5 ; Desc: Medium
- new selected value: 2021-02
- contract valid = Yes
- Amount of rooms: 6 ; Desc: Large
Could you please help me with DAX?
Thanks!
I don't think you need DAX for that. Let the data model do the work for you. Where are you stuck?
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |