Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi, I have a table with a list of material with a unique code with the relative purchase cost.
For each row there is an entry date and an exit date. I would like to be able to view a list with the material present on a specific date.
I have set up a calendar table with no relationships. I added a calculated column to the table with the material in order to filter the list later. This is what I put in the calculated column, but it doesn't work. What's wrong?
column =
var seldata = SELECTEDVALUE(calendario[Date])
var datacons = Query1[Consegna]
var dataarr = Query1[Carico]
return
IF((dataarr<seldata && datacons>=seldata),1,0)
thanks
Solved! Go to Solution.
Create a measure to identify the rows in which the date_in is before the minimum date selected and the out_date is after the maximun date selected using:
Code In Stock =
VAR InDate = MIN(calendario[Date])
Var OutDate = MAX(calendario[Date])
RETURN
COUNTROWS(
CALCULATETABLE(
VALUES(Foglio1[code]),
FILTER(Foglio1,
Foglio1[date_in] <= InDate &&
Foglio1[date_out] > OutDate)))
Add this measure to the filter on the visual in the filter pane and set the value to 1.
I've attached the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Create a measure to identify the rows in which the date_in is before the minimum date selected and the out_date is after the maximun date selected using:
Code In Stock =
VAR InDate = MIN(calendario[Date])
Var OutDate = MAX(calendario[Date])
RETURN
COUNTROWS(
CALCULATETABLE(
VALUES(Foglio1[code]),
FILTER(Foglio1,
Foglio1[date_in] <= InDate &&
Foglio1[date_out] > OutDate)))
Add this measure to the filter on the visual in the filter pane and set the value to 1.
I've attached the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Hi, @matteob
You need to know that the calculated column is calculated when the data is loaded. It won't change with your choice. To filter the data, you need to change the calculated column to measure, and then put it in the filterpane.
measure =
VAR seldata =
SELECTEDVALUE ( calendario[Date] )
VAR datacons = SELECTEDVALUEQuery1[Consegna]
VAR dataarr = SELECTEDVALUEQuery1[Carico]
RETURN
IF ( ( dataarr < seldata && datacons >= seldata ), 1, 0 )
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @v-janeyg-msft,
I tried with the measure as you said, but unfortunately the table view is not filtered.
@matteob ,Have you put it in filter pane?
Like this:
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-janeyg-msft, yes, I tried,
but it doesn't work, the measure gives me the table values only with 0
Hi, @matteob
It's difficult to see the problem with only a formula. Can you share same sample data? So we can help you soon.
Best Regards
Janey Guo
Hi, @v-janeyg-msft,
this is the sample file.
https://www.dropbox.com/s/29wbqudkcaknuhm/date_in_out_test.pbix?dl=0
Thank you very much for your help.
Matteo
Is there another way to view the table filtered on these dates ?
@matteob , You can not create a column with the selected value. Means you can not use slicer value in measure, you have to use it in a measure
Ok thanks for the reply.
Yes, in fact, in a "measure" I managed to make the sum of the costs with these parameters.
Is there another way to view the table filtered on these dates?
I should also see the list of material present on the date entered.