Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I have 2 columns both having the whole numbers in the range of 1 to 90, let's call them Col A and Col B.
I am using Col B as a slicer in Power BI.
I want to make a measure that gives me 1 if the value of Col A >= max value of Col B as selected in the slicer (as mentioned I am using Col A as slicer), else 0.
Here max value of col B refers to the max selected value of Col B.
Solved! Go to Solution.
Hi @AMAN560 ,
Create a table as below:
Table 2 = GENERATESERIES(1,MAX('Table'[Col B]),1)
Then create a measure as below:
Measure =
VAR _maxvalue =
CALCULATE ( MAX ( 'Table 2'[Value] ), ALLSELECTED ( 'Table 2' ) )
RETURN
IF ( MAX ( 'Table'[Col A] ) < _maxvalue, 0, 1 )
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
here is the sample data
Table | |
Col A | Col B |
1 | 32 |
23 | 12 |
4 | 7 |
6 | 2 |
65 | 75 |
6 | 12 |
22 | 53 |
2 | 1 |
34 | 3 |
12 | 2 |
67 | 23 |
76 | 76 |
Now I am using Col B as a slicer and the selected value is 20.
Now I want a table with COL A and the required measure as:
Col A | Measure (Col B=20) |
1 | 0 |
23 | 1 |
4 | 0 |
6 | 0 |
65 | 1 |
6 | 0 |
22 | 1 |
2 | 0 |
34 | 1 |
12 | 0 |
67 | 1 |
76 | 1 |
Now if I select value of COl B in slicer as 30 then:
Col A | Measure (Col B=30) |
1 | 0 |
23 | 0 |
4 | 0 |
6 | 0 |
65 | 1 |
6 | 0 |
22 | 0 |
2 | 0 |
34 | 1 |
12 | 0 |
67 | 1 |
76 | 1 |
can you provide some sample data with what you expect your result to look like, its easier to understand that way
Proud to be a Super User!
I have sent the sample data in comment below
Hi @AMAN560 ,
Create a table as below:
Table 2 = GENERATESERIES(1,MAX('Table'[Col B]),1)
Then create a measure as below:
Measure =
VAR _maxvalue =
CALCULATE ( MAX ( 'Table 2'[Value] ), ALLSELECTED ( 'Table 2' ) )
RETURN
IF ( MAX ( 'Table'[Col A] ) < _maxvalue, 0, 1 )
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
69 | |
66 | |
51 | |
32 |
User | Count |
---|---|
114 | |
99 | |
75 | |
65 | |
40 |