Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have the following problem.
Create a measure :
NewTableLastDate =
var
Find =SWITCH(
WEEKDAY(TODAY(),2)
,1,today()-4
,7,today()-3
,6,today()-2
,today()-1
)
Var compare = if(
Find > max('tbl'[Dates])
,max('tbl'[Dates])
,Find
)
return compare
then a create a table:
Solved! Go to Solution.
I have found the solution,
Hi @Slaper ,
What Greg_Deckler said makes sense.
In DAX, measures are designed to aggregate data and return a single value.
The problem arises from trying to compare the column directly to the measure in the function. You should use calculated columns to achieve the desired results.
Replace NewTableLastDate with a calculated column so that you can use this column directly in filter expressions.
I would be grateful if you could provide me with sample data, please remove any sensitive data in advance.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
I have found the solution,
Sorry, how to upload a .pbix
@Slaper You can't use measures like that. Measures are for use at the reporting level.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |