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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi All,
I have a table like below. If select date range in a slicer between Start Date=01/04/2021 to End date =30/06/2021 it should get all the 'Active' Pol numbers before the start date. Then it need to check whether that Active pol number is 'calcelled' between the start date and end date. If it is cancelled then i need to get the Original Comm like 500-300=200 as the pol is cancelled.
If i select date range between Start Date = 01/07/2021 and End Date = 30/09/2021 it need to check all the pol num which were Active and Cancelled before the start date. Then it need to check if the Active and Cancelled pol nums are Reintiated between the start date and end date. If it is reintiated i need to get the Cancellation comm like -300+200=-50
Thanks in advance.
Table:
Expected O/P
@Anonymous , based on what I got. Assume date is selected using independent date table
Measure =
VAR _max = MAXX(allselected('Date1'),'Date1' [date])
var _min = MinX(allselected('Date1'),'Date1' [date])
var _Active = calculate(sum(Table[Comm]), filter( Table, Table[End date]<= _max and Table[End date]>=_min && Table[Tran Type] ="Active"))
var _can = calculate(sum(Table[Comm]), filter( Table, Table[End date]<= _max and Table[End date]>=_min && Table[Tran Type] ="Cancelled"))
var _re= calculate(sum(Table[Comm]), filter( Table, Table[End date]<= _max and Table[End date]>=_min && Table[Tran Type] ="Reintiated"))
return
if(isblank(_re), _Active + _can , _re+_can)
@amitchandak this does nto work for me. There is no logic in your query you have directly taken the values and filtered them any way thanks.
User | Count |
---|---|
98 | |
76 | |
75 | |
49 | |
27 |