March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I have to calculate a measure which should be based on the following logic:
if "weekend date" = in between ("quarter start date" and "quarter end date") then "Total Hours" else "0"
Note: "Total Hours" is a measure which 3 others are table's columns -"weekend date" , "quarter start date" and "quarter end date"
Thanks
Solved! Go to Solution.
@Anonymous ,
Create a measure using dax as below:
Result = IF(MAX('Table'[weekend date]) >= MAX('Table'[Quarter Start Date]) && MAX('Table'[weekend date]) <= MAX('Table'[Quarter End Date]), MAX('Table'[Total Hours]), 0)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output.
See if this file can help you. https://www.dropbox.com/s/bu47m5ek7sr9v8t/sales_analytics_v2.pbix?dl=0
Hi,
I believe this would be more clear:
weekend date | Quarter Start Date | Quarter End Date | Total Hours | (Required Measure) |
2/23/2020 | 1/6/2020 | 4/5/2020 | 140 | 140 |
5/20/2020 | 4/6/2020 | 7/5/2020 | 89 | 89 |
1/2/2020 | 4/6/2020 | 7/5/2020 | 123 | 0 |
6/8/2020 | 1/6/2020 | 4/5/2020 | 88 | 0 |
3/12/2020 | 1/6/2020 | 4/5/2020 | 212 | 212 |
@Anonymous ,
Create a measure using dax as below:
Result = IF(MAX('Table'[weekend date]) >= MAX('Table'[Quarter Start Date]) && MAX('Table'[weekend date]) <= MAX('Table'[Quarter End Date]), MAX('Table'[Total Hours]), 0)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
Measure=
var _weekendDate = SELECTEDVALUE(Table[weekend date])
IF(_weekendDate >= SELECTEDVALUE(Table[quarter start date]) && _weekendDate <= SELECTEDVALUE(Table[quarter end date]), Table[TotalTime], 0)
@Anonymous
will it help a simple statement like
Measure=
IF(Table[weekend date] >= Table[quarter start date] && Table[weekend date] <= Table[quarter end date], Table[TotalTime], 0)
Hi @Anonymous ,
Please see this post regarding How to Get Your Question Answered Quickly (courtesy of @Greg_Deckler) and How to provide sample data in the Power BI Forum (courtesy of @ImkeF).
Without example data is difficult to give you a better help.
If you can share a sample data (especially on the dates columns) and if you are using a calendar table or dates within your data table would be helpfull to assist you.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
44 |
User | Count |
---|---|
204 | |
105 | |
99 | |
64 | |
54 |