Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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 @Anonymous ,
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 @Anonymous ,
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!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 32 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 38 | |
| 35 | |
| 25 |