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.
Hello!
I have a dataset looking like this:
Date | ID | Category | Value |
01012019| | 45 | Quantity | 439579 |
01012019| | 45 | Leadtime | |
01012019| | 46 | Quantity | 32142 |
01012019| | 46 | Leadtime | 10 |
01022019| | 45 | Quantity | 35436 |
01022019| | 45 | Leadtime | 2 |
I only want to count the value on quantity if the leadtime is not blank.
Do you have any idea how I should filter?
Quantity tot of selected =
CALCULATE(
SUM(Data[Value]),
FILTER(ALLSELECTED(Data), Data[Category]="Quantity")
)
This is how far I've come.
Thank you for your help!
Solved! Go to Solution.
Hi @Anonymous
use this measure:
Measure =
var tab =selectcolumns( filter(summarize('Table', 'Table'[Date], 'Table'[ID], "t", calculate(sum('Table'[Value]), 'Table'[Category] = "Leadtime")), [t]<>blank()), "date",'Table'[Date],"id", 'Table'[ID])
return
calculate( sum('Table'[Value]), FILTER(ALL('Table'),'Table'[Category]="Quantity"),INTERSECT(tab, selectcolumns('Table', "date",'Table'[Date],"id", 'Table'[ID])))
result:
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
use this measure:
Measure =
var tab =selectcolumns( filter(summarize('Table', 'Table'[Date], 'Table'[ID], "t", calculate(sum('Table'[Value]), 'Table'[Category] = "Leadtime")), [t]<>blank()), "date",'Table'[Date],"id", 'Table'[ID])
return
calculate( sum('Table'[Value]), FILTER(ALL('Table'),'Table'[Category]="Quantity"),INTERSECT(tab, selectcolumns('Table', "date",'Table'[Date],"id", 'Table'[ID])))
result:
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
you can try this
select quantity column and pivot column in PQ
then create a measure
CALCULATE(
SUM(Data[Value]),
FILTER(Data, leadtime<>"")
)
Proud to be a Super User!
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 |
---|---|
108 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |