Forum Discussion
Maverick423
6 years agoRegular Visitor
Retrieve just one quote
Hello PBI Experts, In my report, I have a table that should contain selected fields from Opportunity and Quotes. I need to retrieve just one or the first quote linked to an entity considering that O...
- 6 years ago
Hi Maverick423
You can create a Measure like below, and use it later as Filters in your Table visual.
Measure = VAR _firstQuoteID = { CALCULATE( MAX( Quotes[qtID] ), ALL( Quotes[qtID] ) ) } RETURN CALCULATE( COUNTROWS( Quotes ), KEEPFILTERS( TREATAS( _firstQuoteID, Quotes[qtID] ) ) )The attached file contains an applied solution.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Mariusz
Community Champion
6 years ago- Maverick4236 years agoRegular Visitor
Hello Mariusz,
Please see below for my test data in a table:
As you can see, I have here two Quotes under 1 Opportunity. The requirement is just to diplay the first Quote if there are 2 or more Quotes linked to an Opportunity. Is it possible to do it using DAX?
Regards,
Maverick423
- Mariusz6 years ago
Community Champion
Hi Maverick423
You can create a Measure like below, and use it later as Filters in your Table visual.
Measure = VAR _firstQuoteID = { CALCULATE( MAX( Quotes[qtID] ), ALL( Quotes[qtID] ) ) } RETURN CALCULATE( COUNTROWS( Quotes ), KEEPFILTERS( TREATAS( _firstQuoteID, Quotes[qtID] ) ) )The attached file contains an applied solution.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
- Maverick4236 years agoRegular Visitor
Hi Mariusz,
Thank you ever so much for this. You're a genius!!
It solved my problem instantly:)
Regards,
Maverick423