Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I need help in resolving a issue. There are 2 tables which are connected to each other with 1 to many relationship and a date table.
My tables refreshes every day. I am using a slicer to filter the date. My requirement is to capture the output of say yesterday and it shouldn't change. Means for the date selected in slicer, i should be able to get the status for that day only.
I am using the below dax function to perform the action but it is giving me incorrect output.
Max_Status = calculate(Max(SCH[CO_ST]),ALLEXCEPT(SCH,SCH[ID]))
@amitchandak I guess I was not able to ask my question correctly. My requirement is if I select say 21st Oct on slicer, I will be able to get the status of the records for that day only and not as on yesterday. Records can have different status on different dates. Status should change based on slicer dates.
@SachinFG , In case you need to save a date like yesterday and today.
Have a column like this in your date table and sort it on the date and save on yesterday
Date Type = SWITCH(TRUE(),'Date'[Date]=TODAY(),"Today",'Date'[Date]=TODAY()-1,"Yesterday",'Date'[Date]&"")
refer:https://www.youtube.com/watch?v=hfn05preQYA
or measure like
This Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Last Day = CALCULATE(sum('order'[Qty]), previousday('Date'[Date]))
@SachinFG think allexcept function overwrite the filter context comes from date table. try this code
Max_Status = calculate(Max(SCH[CO_ST]),ALLEXCEPT(SCH,SCH[ID]),values(dates[date]))
I guess I was not able to ask my question correctly. My requirement is if I select say 21st Oct on slicer, I will be able to get the status of the records for that day only and not as on yesterday. Records can have different status on different dates. Status should change based on slicer dates.
@SachinFG , if it is connected with date that should happen.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
20 | |
20 | |
16 | |
15 |
User | Count |
---|---|
46 | |
28 | |
25 | |
18 | |
17 |