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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sirros_iot
Helper IV
Helper IV

Choosing different variable

Hello all! *I can't use calculated column because I'm getting the data by Streaming Direct Query on PBI online..

I would like to choose the variable value, for example..
MEASURE A.PNGThis is level fiter, and is selected "is = 2", sorry about the portuguese...


Measure A = //I don't know how to do it

Measure B = 
          IF{ table [Measure A] = 1; This does something;
                   IF{ table [Measure A] = 2; This does otherthing( Would select this if Measure A was working, as you can see at the image above); 
                             IF{ table [Measure A] = 3; This is the command that I want to select via level filter;
                                        IF{ table [Measure A] = 4; As this one...; 
}

This is just a way I think can solve my problem, I want to select different functions into one measure( Measure B). And I want to insert Measure B in one visual table. Doesn't exist a way of inserting data into the report, right, like...
CALCULATING CAR SPEED
Insert distance:_______
Insert time:_______
                                CALCULATE

Thank you all,
Best Regards,

Diego

 

1 ACCEPTED SOLUTION

Hi @sirros_iot,

 

 

You need to have a reference to a column or another table that allows you to do it.

 

Regards,

MFelix

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

6 REPLIES 6
MFelix
Super User
Super User

Hi @sirros_iot,

Not sure about the question you are making not really explicit and with very little data.

Regarding the last part of you question you can add variables in your DAX expression something like

CAR SPEED =
VAR InsertDistance = MAX(Table[Distance])
Var Inserttime = MAX(Table[Speed])

Return
CALCULATE (insertdistabce x inserttime)


Can you share sample.data.and expected.result for better help.

Regards
MFelix

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hello @MFelix, do you if it is possible?

 

Thanks,

Diego

Hi @sirros_iot,

 

I created a PBIX file with a sample data, I have created a table with the What If option on the modeling tab,

 

Then created a measure with a variable that is based on the table created in the previous step, that selects the lue on the slicer.

 

This is just a simple example but it how it works.

 

variable.gif

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you for the reply @MFelix! That's what I would like to do!

 

But I think I can't create that parameter table.. I'm getting the data by Push Streaming Dataset
Do you know a way of doing that without creating any data? 

Best Regards,
Diego

Hi @sirros_iot,

 

 

You need to have a reference to a column or another table that allows you to do it.

 

Regards,

MFelix

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Sorry about the mess ... I don't have PRO level to share you the report.. I will try to explain it better I have a visual table in my report, and there I have one column that is a measure. The measure has a variable, but I don't have value to that variable. I want to choose the variable value, is that possible? Is there a way of entering the data? Or selecting from 4 options could be a way. Thank you, Diego

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.