Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello all,
I want to compare sales included in Current Quarter depending on the Closed or Open date, see the table below
So with this measure the goal is to calculate the maturity of each sale or how much time each sale takes to be closed if it's included on the Quarter. Any help would be really appreciated, thanks
Solved! Go to Solution.
Hi @Anonymous ,
Please correct me if I wrongly understood your question.
Firstly, matrix does not support sub header, if you want to return the datediff in matrix visual, that is not feasible .
My suggestion is to create 4 measures to return the datediff in table visual .
(1)I create two tables, ‘duration data’ and ‘Qty’, like this
(2)Use IF dax to create 4 measures to return the datediff .
1Q = IF(MAX('duration date'[Closed date])<MAX(Qty[1Q]) || MAX('duration date'[Open date])>MAX(Qty[1Q]),"Exclude",DATEDIFF(MAX('duration date'[Open date]),MAX(Qty[1Q]),DAY))
2Q = IF(MAX('duration date'[Closed date])<MAX(Qty[2Q]) || MAX('duration date'[Open date])>MAX(Qty[2Q]),"Exclude",DATEDIFF(MAX('duration date'[Open date]),MAX(Qty[2Q]),DAY))
3Q = IF(MAX('duration date'[Closed date])<MAX(Qty[3Q]) || MAX('duration date'[Open date])>MAX(Qty[3Q]),"Exclude",DATEDIFF(MAX('duration date'[Open date]),MAX(Qty[3Q]),DAY))
4Q = IF(MAX('duration date'[Closed date])<MAX(Qty[4Q]) || MAX('duration date'[Open date])>MAX(Qty[4Q]),"Exclude",DATEDIFF(MAX('duration date'[Open date]),MAX(Qty[4Q]),DAY))
The effect is as shown:
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please correct me if I wrongly understood your question.
Firstly, matrix does not support sub header, if you want to return the datediff in matrix visual, that is not feasible .
My suggestion is to create 4 measures to return the datediff in table visual .
(1)I create two tables, ‘duration data’ and ‘Qty’, like this
(2)Use IF dax to create 4 measures to return the datediff .
1Q = IF(MAX('duration date'[Closed date])<MAX(Qty[1Q]) || MAX('duration date'[Open date])>MAX(Qty[1Q]),"Exclude",DATEDIFF(MAX('duration date'[Open date]),MAX(Qty[1Q]),DAY))
2Q = IF(MAX('duration date'[Closed date])<MAX(Qty[2Q]) || MAX('duration date'[Open date])>MAX(Qty[2Q]),"Exclude",DATEDIFF(MAX('duration date'[Open date]),MAX(Qty[2Q]),DAY))
3Q = IF(MAX('duration date'[Closed date])<MAX(Qty[3Q]) || MAX('duration date'[Open date])>MAX(Qty[3Q]),"Exclude",DATEDIFF(MAX('duration date'[Open date]),MAX(Qty[3Q]),DAY))
4Q = IF(MAX('duration date'[Closed date])<MAX(Qty[4Q]) || MAX('duration date'[Open date])>MAX(Qty[4Q]),"Exclude",DATEDIFF(MAX('duration date'[Open date]),MAX(Qty[4Q]),DAY))
The effect is as shown:
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you sooo much, this totally worked 🙂
@Anonymous , not very clear, Refer this blog
And the file attached for Open items between date and comparison
Thanks so much, however I need to exclude whenever:
"Open Date" is < "Reference Date"
or
"Closed Date" >"Reference Date"
Your input is much appreciated
Thanks
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
80 | |
53 | |
39 | |
39 |
User | Count |
---|---|
104 | |
85 | |
47 | |
44 | |
43 |