Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Microsoft Power BI Community
- Forums
- Get Help with Power BI
- Desktop
- How i can make "what if scenario" applied only in ...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

How i can make "what if scenario" applied only in one (table) row

09-17-2017
05:47 AM

How can I make a calculation (New value) on a single line (only in one row) of the table, by selecting from a list containing numbers (1-4).

For example, I select the number 1 from the list and I would like to apply the statement in line 1, column New Value, of the table.

See in the picture below how I would like to work.

Solved! Go to Solution.

2 ACCEPTED SOLUTIONS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-18-2017
11:40 PM

@kkapsokavadis wrote:

Finally, i found the solution.

i've made 2 measures, one for each Id (Row Id & Selection Id).

Sum_Choises_PK = SUM( Choises[Choises_PK] )

Sum_wif_id = SUM(wif[id])

Then i've made the Measure for "what if Value"

wif Value = if (wif[Sum_wif_id]=Choises[Sum_Choises_PK]; sum(wif[Value]) + sum(wif[Value]) * Parameter[Parameter Value] / 100 ; sum(wif[Value]))

Now, im faced with with a new (2) problems:

As you can see:

a. The Total of the [wif Value] is incorrect. The correct value is 120.000

b. The Calculated Column [New Running total] --> (New Quick Measure -> Running Total), also is incorrect

New Running total =

CALCULATE(

'wif'[wif Value];

FILTER(

ALLSELECTED('wif'[id]);

ISONORAFTER('wif'[id]; MAX('wif'[id]); DESC)

)

)

any suggestions are welcome!!

You can try to change the measure a little bit.

wif Value = VAR summurizedTbl = SUMMARIZE ( wif, wif[id], "total value", IF ( wif[id] = Choises[Sum_Choises_PK], SUM ( wif[Value] ) + SUM ( wif[Value] ) * Parameter[Parameter Value] / 100, SUM ( wif[Value] ) ) ) RETURN IF ( HASONEVALUE ( wif[id] ), IF ( wif[Sum_wif_id] = Choises[Sum_Choises_PK], SUM ( wif[Value] ) + SUM ( wif[Value] ) * Parameter[Parameter Value] / 100, SUM ( wif[Value] ) ), SUMX ( summurizedTbl, [total value] ) )

See more details in the attched pbix file.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-17-2017
10:41 AM

Finally, i found the solution.

i've made 2 measures, one for each Id (Row Id & Selection Id).

Sum_Choises_PK = SUM( Choises[Choises_PK] )

Sum_wif_id = SUM(wif[id])

Then i've made the Measure for "what if Value"

wif Value = if (wif[Sum_wif_id]=Choises[Sum_Choises_PK]; sum(wif[Value]) + sum(wif[Value]) * Parameter[Parameter Value] / 100 ; sum(wif[Value]))

Now, im faced with with a new (2) problems:

As you can see:

a. The Total of the [wif Value] is incorrect. The correct value is 120.000

b. The Calculated Column [New Running total] --> (New Quick Measure -> Running Total), also is incorrect

New Running total =

CALCULATE(

'wif'[wif Value];

FILTER(

ALLSELECTED('wif'[id]);

ISONORAFTER('wif'[id]; MAX('wif'[id]); DESC)

)

)

any suggestions are welcome!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-18-2017
11:40 PM

@kkapsokavadis wrote:

Finally, i found the solution.

i've made 2 measures, one for each Id (Row Id & Selection Id).

Sum_Choises_PK = SUM( Choises[Choises_PK] )

Sum_wif_id = SUM(wif[id])

Then i've made the Measure for "what if Value"

wif Value = if (wif[Sum_wif_id]=Choises[Sum_Choises_PK]; sum(wif[Value]) + sum(wif[Value]) * Parameter[Parameter Value] / 100 ; sum(wif[Value]))

Now, im faced with with a new (2) problems:

As you can see:

a. The Total of the [wif Value] is incorrect. The correct value is 120.000

b. The Calculated Column [New Running total] --> (New Quick Measure -> Running Total), also is incorrect

New Running total =

CALCULATE(

'wif'[wif Value];

FILTER(

ALLSELECTED('wif'[id]);

ISONORAFTER('wif'[id]; MAX('wif'[id]); DESC)

)

)

any suggestions are welcome!!

You can try to change the measure a little bit.

wif Value = VAR summurizedTbl = SUMMARIZE ( wif, wif[id], "total value", IF ( wif[id] = Choises[Sum_Choises_PK], SUM ( wif[Value] ) + SUM ( wif[Value] ) * Parameter[Parameter Value] / 100, SUM ( wif[Value] ) ) ) RETURN IF ( HASONEVALUE ( wif[id] ), IF ( wif[Sum_wif_id] = Choises[Sum_Choises_PK], SUM ( wif[Value] ) + SUM ( wif[Value] ) * Parameter[Parameter Value] / 100, SUM ( wif[Value] ) ), SUMX ( summurizedTbl, [total value] ) )

See more details in the attched pbix file.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Announcements

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Featured Topics

Top Solution Authors

User | Count |
---|---|

441 | |

194 | |

109 | |

56 | |

49 |

Top Kudoed Authors

User | Count |
---|---|

477 | |

237 | |

134 | |

75 | |

74 |