Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi ,
I hope you are doing great.
I need to create a Measure or any solution similar for to have in a Card the next calculation:
The Selected DATE taken from two Slicers Year, Month must be less and Filter another Field where the values are blanks or the values are greater than Selected date in the slicers.
The main issues is that I have two relationships between the table and Calendar and for that calculations its neccesary to use both.
Tables and Fields:
tb_employees
tb_Cal (Calendar)
Relationship between tables
I created a Measure but isn't working good because I must use the relation inactive.
I attached the .pbix. (click)
Thank you a lot.
Best Regards,
Hernán Montoya
Solved! Go to Solution.
You will need to define what you mean by "before" and "after". Your calendar table has day level granularity yet your slicer is only going to month level.
So - Date 1 is less than the MINIMUM selected date and Date 2 is empty of greater than the MAXIMUM selected date?
Also, your table relationships are not needed in this scenario. You can make both inactive.
Id_Before_Date_Selected =
var mind = minx(Cal,[Date])
var maxd = maxx(Cal,[Date])
var a = filter(tb_employees,[Date1]<mind && COALESCE([Date2],dt"2030-12-31")>maxd)
return COUNTROWS(SUMMARIZE(a,[id]))
You will need to define what you mean by "before" and "after". Your calendar table has day level granularity yet your slicer is only going to month level.
So - Date 1 is less than the MINIMUM selected date and Date 2 is empty of greater than the MAXIMUM selected date?
Also, your table relationships are not needed in this scenario. You can make both inactive.
Id_Before_Date_Selected =
var mind = minx(Cal,[Date])
var maxd = maxx(Cal,[Date])
var a = filter(tb_employees,[Date1]<mind && COALESCE([Date2],dt"2030-12-31")>maxd)
return COUNTROWS(SUMMARIZE(a,[id]))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |