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
terpilka
Helper I
Helper I

Exchange measures

Hi all, 

Could you help me, please,


Could you share your experience how I can realize the follow logic:
If I filter region=region2
When I create a pivot table in PowerBI  with filter I want to calculate:

for  "old" in indicator ="175"
FOR "new " in indicator ="45"

Please find the attachment as an example from Excel.

I try to solve it in the follow way:
DurationNew = if(VALUES('Project Tasks'[indicator])="ALL",CALCULATE(SUM('Project Tasks'[TaskDuration]),FILTER('Project Tasks','Project Tasks'[indicator]="old"),ALL('Project Tasks'[Region])),
CALCULATE(SUM('Project Tasks'[TaskDuration]),FILTER('Project Tasks','Project Tasks'[indicator]="new"),ALLselected('Project Tasks'[Region])))

But then I use filter in region, I have both of them filtered.
I need the table in this format, nobody don't use the column "indicator" as a filter.
regions.PNG
Many thanks, 
BR, Valeria.



1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi,@terpilka

      After my research, you can do these follow my steps like below:

Step 1:

use this formula to add a new table and create the relationship with basic table

regions = VALUES('Project Tasks'[region])

18.PNG

Step 2:

create a measure by using formula like below:

Measure 4 = if(min('Project Tasks'[indicator]) = "old",CALCULATE( sum('Project Tasks'[TaskDuration]), all(regions[region])), if(min('Project Tasks'[indicator]) = "new", sum('Project Tasks'[TaskDuration]), 999))

Step3:

Darg field regions from table Regions into slicer visual

Result:

19.PNG

here is demo, please try it.

https://www.dropbox.com/s/awpgenjbhp5ewje/new%20exchange.pbix?dl=0

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi,@terpilka

      After my research, you can do these follow my steps like below:

Step 1:

use this formula to add a new table and create the relationship with basic table

regions = VALUES('Project Tasks'[region])

18.PNG

Step 2:

create a measure by using formula like below:

Measure 4 = if(min('Project Tasks'[indicator]) = "old",CALCULATE( sum('Project Tasks'[TaskDuration]), all(regions[region])), if(min('Project Tasks'[indicator]) = "new", sum('Project Tasks'[TaskDuration]), 999))

Step3:

Darg field regions from table Regions into slicer visual

Result:

19.PNG

here is demo, please try it.

https://www.dropbox.com/s/awpgenjbhp5ewje/new%20exchange.pbix?dl=0

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Many thanks,

It works.

 

BR, 

Valeria!

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.