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
I'm having difficulty in calculating this. Client wants to calculate the amount of days from today (when the report is run) to an order date, but wants to filter on other column in the data.
This is what I have so far, Calculate Number of Days=DATEDIFF ( MAX ( 'table'[column]), TODAY(), DAY )
Because some orders are canceled, on back order, out of stock, ect., they want to filter by order status (another column in the table) to omit orders that canceled, or out of stock. How do I add a filter to the above measure?
Also the data is in a semantic model, and I am not able to add a calculated column, so this needs to be done with a measure.
Can anyone help me? Is this even possible?
May I ask if your problem has been solved? If it has been resolved, please accept the responses that helped you as a solution.
Both solutions provided by Irwan and shafiz_p are valid, you can follow Irwan's solution to create a slicer to filter orders or follow shafiz_p's solution to filter out orders in the measure.
If you need any other help, please feel free to contact me.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Neither solution solved the issue
Could you please provide sample data that covers your issue completely and the expected outcome. This will help us understand your needs more clearly and assist you.
If you are unsure how to upload data please refer to How to provide sample data in the Power BI Forum - Microsoft Fabric Community
A friendly reminder to remember to protect your data privacy.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Dashboard_Dev As I can understand, that you have order status column and want to filter out Canceled or out of stock using your provided measure.
You can use slicer as @Irwan mentioned or can use filter this visual section in filter pane to filter out unnecessary items.
Any way, if you want to use measure, then wrap your measure inside calculate and mention filter condition. See the example below:
hello @Dashboard_Dev
are you looking something like this?
create a new measure with following DAX.
DateDIFF = DATEDIFF(MAX('Table'[Date]),TODAY(),DAY)
March 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 |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
26 | |
21 | |
20 | |
14 | |
10 |