Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi, I have a Calendar table like below. This table is connected with a Fact Table (Which has Date and Sales)
Scenario: I would like to create two score card, one for MTD and another for LYMTD which will be based on a Calendar date slicer on my report.
Challenge: When I select 25th March, On one card I should see MTD and on another card, I would like to see LYMTD (based on available dates in the LYDate column and note on the calendar date)
Example: LYMTD should only count dates from 02-Mar-22 to 23-March-22 + 02-Apr-222 to 04-Apr-222.
Basically, I want to compare MTD and LYMTD by row and not by dates.
Also, it should be dynamic.
@AllisonKennedy I tried but the above measure is not working. No, the LYDate can be changed by the business user.
@iamhuz Sorry for the delay in reply. What does your data model look like? Did you create the inactive relationship first? What about the above measure doesn't work?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@iamhuz Is the LYDate unique? You could create an inactive relationship and use USERELATIONSHIP inside a calculate measure:
measure = calculate ( [this year measure], USERELATIONSHIP ( factTable[date], dateTable[LYdate] ) )
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
118 | |
101 | |
71 | |
61 |