Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
AMAN560
Frequent Visitor

Situation in making a measure in power bi

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.

1 ACCEPTED 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:

vkellymsft_0-1629183945522.pngvkellymsft_1-1629183963409.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

View solution in original post

4 REPLIES 4
AMAN560
Frequent Visitor

here is the sample data

Table
Col ACol B
132
2312
47
62
6575
612
2253
21
343
122
6723
7676

 

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 AMeasure (Col B=20)
10
231
40
60
651
60
221
20
341
120
671
761

 

Now if I select value of COl B in slicer as 30 then:

Col AMeasure (Col B=30)
10
230
40
60
651
60
220
20
341
120
671
761
vanessafvg
Super User
Super User

can  you provide some sample data with what you expect your result to look like, its easier to understand that way





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

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:

vkellymsft_0-1629183945522.pngvkellymsft_1-1629183963409.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.