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'm new to Power Bi and trying to create a formula that will return an equipment number if:
- an equipment number in column Equipment is listed more than once AND
- at least one line of the matching equipment numbers under column Location has "Showroom" or "Training" AND
- at least one line of the matching equipment numbers under column Invoice Date has a date AND
- at least one line of the matching equipment numbers under column Order Type has the keyword "Sale"
Solved! Go to Solution.
Hi @Antje ,
Create a custom column with below code and use it as filter on your visual:-
Column =
VAR _count =
COUNTROWS (
FILTER (
'Table (5)',
'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
)
)
VAR _location =
COUNTROWS (
FILTER (
'Table (5)',
'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
&& 'Table (5)'[Location] IN { "Showroom", "Location" }
)
)
VAR _invoice_Date =
COUNTROWS (
FILTER (
'Table (5)',
'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
&& 'Table (5)'[Invoice date] <> BLANK ()
)
)
VAR _ordertype =
COUNTROWS (
FILTER (
'Table (5)',
'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
&& 'Table (5)'[Order type] IN { "Sale" }
)
)
RETURN
IF (
_count >= 2
&& _location >= 1
&& _invoice_Date >= 1
&& _ordertype >= 1,
1,
0
)
output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Thank you so much, Samarth! This worked perfectly.
Hi @Antje ,
Create a custom column with below code and use it as filter on your visual:-
Column =
VAR _count =
COUNTROWS (
FILTER (
'Table (5)',
'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
)
)
VAR _location =
COUNTROWS (
FILTER (
'Table (5)',
'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
&& 'Table (5)'[Location] IN { "Showroom", "Location" }
)
)
VAR _invoice_Date =
COUNTROWS (
FILTER (
'Table (5)',
'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
&& 'Table (5)'[Invoice date] <> BLANK ()
)
)
VAR _ordertype =
COUNTROWS (
FILTER (
'Table (5)',
'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
&& 'Table (5)'[Order type] IN { "Sale" }
)
)
RETURN
IF (
_count >= 2
&& _location >= 1
&& _invoice_Date >= 1
&& _ordertype >= 1,
1,
0
)
output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
145 | |
79 | |
64 | |
52 | |
47 |
User | Count |
---|---|
216 | |
89 | |
76 | |
67 | |
60 |