Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I am new to Power Bi and currently havving challenges in creating an IF Statement.
Here's what I am trying to accomplish.
Status column is in Table 1
Sales count, Price and Quantity is in Table 2
What I want is something like this: If Status = "OLD",Price/ Sales Count else Price/ Sales Count times Quantity.
Appreciate any response.
Thank You!
Solved! Go to Solution.
Hi @jhen_1020,
If [Status], [Sales count], [Price] and [Quantity] are all added into the same visual, please try this similar measure:
If Status = IF ( SELECTEDVALUE ( 'Table1'[Status] ) = "OLD", SELECTEDVALUE ( Table2[Price] ) / SELECTEDVALUE ( Table2[Sales Count] ), SELECTEDVALUE ( Table2[Price] ) / SELECTEDVALUE ( Table2[Sales Count] ) * SELECTEDVALUE ( Table2[Quantity] ) )
Regards,
Yuliana Gu
Hi @jhen_1020,
If [Status], [Sales count], [Price] and [Quantity] are all added into the same visual, please try this similar measure:
If Status = IF ( SELECTEDVALUE ( 'Table1'[Status] ) = "OLD", SELECTEDVALUE ( Table2[Price] ) / SELECTEDVALUE ( Table2[Sales Count] ), SELECTEDVALUE ( Table2[Price] ) / SELECTEDVALUE ( Table2[Sales Count] ) * SELECTEDVALUE ( Table2[Quantity] ) )
Regards,
Yuliana Gu
Hi,
Is there a connecting column between the 2 datasets? If yes, then which one is it?
the two tables are connected by name.
Hi,
Share the dataset and show the expected result.
HI @jhen_1020
Are you trying to add a calculated measure or column? If you are trying to add a calculated column, which of the tables are you adding it to?
Hi, I am trying to add a measure.
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
104 | |
93 | |
83 | |
64 |