- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Creating measure
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-27-2017 04:10 AM
Hi,
The table below show gross revenue and disbursement for a lot of projects (only one shown though). On my report canvas I want a slicer where I can toggle between Gross Revenue and Net Revenue, where Net Revenue should be calculated as Net Revenue = Gross Revenue + Disbursement.
I imagine I should create a New Measure but since Power BI and DAX is quite new to me I can't find out how.
Any ideas?
Table1
Project | Type | Amount |
158894 | Gross Revenue | 2000 |
158894 | Gross Revenue | 1500 |
158894 | Gross Revenue | 1000 |
158894 | Disbursement | -700 |
158894 | Disbursement | -300 |
Solved! Go to Solution.
Accepted Solutions
Re: Creating measure
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-27-2017 08:25 PM
Hi @David_1970,
You need an extra table which contains only one column that will be added into slicer later.
Create measures as below:
Gross Revenue = CALCULATE ( SUM ( 'revenue table'[Amount] ), 'revenue table'[Type] = "Gross Revenue" ) Net Revenue = SUM ( 'revenue table'[Amount] )
Revenue =
IF (
LASTNONBLANK ( 'Slicer table'[Revenue Type], 1 ) = "Gross Revenue",
[Gross Revenue],
[Net Revenue]
)
Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
All Replies
Re: Creating measure
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-27-2017 04:25 AM
@David_1970 to toggle look at the tecnique in this video from time 11:37
https://www.youtube.com/watch?v=Mpk9Js5jUeg
to create the measure
Net Revenue = sum(Gross Revenue) + sum(Disbursement)
Proud a to be a Datanaut!
Re: Creating measure
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-27-2017 08:25 PM
Hi @David_1970,
You need an extra table which contains only one column that will be added into slicer later.
Create measures as below:
Gross Revenue = CALCULATE ( SUM ( 'revenue table'[Amount] ), 'revenue table'[Type] = "Gross Revenue" ) Net Revenue = SUM ( 'revenue table'[Amount] )
Revenue =
IF (
LASTNONBLANK ( 'Slicer table'[Revenue Type], 1 ) = "Gross Revenue",
[Gross Revenue],
[Net Revenue]
)
Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Re: Creating measure
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-28-2017 01:20 AM
Hi and thanks!
However, I also seem to get a (blank) tick box option in my slicer on the canvas in addition to the gross revenue and net revenue tick boxes. And revenue is only shown in the card visual when the (blank) tick box is selected, otherwise no revenue is shown.
I guess I have to do some trouble shooting.
Once again, many thank's.