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.
In my source data, there are multiple rows per ID number. I have a simple table visual showing certain values that correspond to that ID number. I want to filter that visual so each ID number only appears once, according to specific criteria. I am pasting dummy sample data below to make this clearer. What I am looking for is the column B value for each ID in column A - however, I only want one single B value for each ID in column A, although my source data has multiple rows with multiple values. If column C is UF, that is the value I want. If there is no UF for a particular ID, then I want the max value that is in B. I have no idea how to do it!
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
It is for creating a measure.
WINDOW function (DAX) - DAX | Microsoft Learn
expected result measure: =
VAR _partitionuf =
FILTER (
WINDOW (
1,
ABS,
-1,
ABS,
ALL ( data ),
ORDERBY ( data[value], DESC ),
,
PARTITIONBY ( data[id] ),
MATCHBY ( data[id], data[value], data[condition] )
),
data[condition] = "uf"
)
VAR _partitionall =
WINDOW (
1,
ABS,
1,
ABS,
ALL ( data ),
ORDERBY ( data[value], DESC ),
,
PARTITIONBY ( data[id] ),
MATCHBY ( data[id], data[value], data[condition] )
)
RETURN
IF (
COUNTROWS ( _partitionuf ) >= 1,
MAXX ( _partitionuf, data[value] ),
MAXX ( _partitionall, data[value] )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Please check the below picture and the attached pbix file.
It is for creating a measure.
WINDOW function (DAX) - DAX | Microsoft Learn
expected result measure: =
VAR _partitionuf =
FILTER (
WINDOW (
1,
ABS,
-1,
ABS,
ALL ( data ),
ORDERBY ( data[value], DESC ),
,
PARTITIONBY ( data[id] ),
MATCHBY ( data[id], data[value], data[condition] )
),
data[condition] = "uf"
)
VAR _partitionall =
WINDOW (
1,
ABS,
1,
ABS,
ALL ( data ),
ORDERBY ( data[value], DESC ),
,
PARTITIONBY ( data[id] ),
MATCHBY ( data[id], data[value], data[condition] )
)
RETURN
IF (
COUNTROWS ( _partitionuf ) >= 1,
MAXX ( _partitionuf, data[value] ),
MAXX ( _partitionall, data[value] )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Try this if you need a measure:
User | Count |
---|---|
20 | |
14 | |
11 | |
8 | |
6 |
User | Count |
---|---|
23 | |
23 | |
20 | |
15 | |
10 |