Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
2 like 0 dislike
3.9k views
in Power BI by 3 3 5

I want to make some extra DAX operations based on slicers Power BI that I have already selected. 

My table "HM POR EQUIPO"  have these columns: 

equip / Month name / HOROMETRO
004315     January       21

004315    December   350

004315     October     446

004315     November   413

...

Also, I have another table "RELLENOS" with a calculated column that has this operation:

HOROMETROX = SUMX(FILTER('HM POR EQUIPO', RELLENOS[cequipo]= 'HM POR EQUIPO'[cequipo]),'HM POR EQUIPO'[HOROMETRO]).

What I want to do is when I select, two values in my slicer January and December, The value of 'HM POR EQUIPO'[HOROMETRO] has to give me a value that is not affected by the month that I don't select.

For example: 

  • If I select January and December, the value of 'HM POR EQUIPO'[HOROMETRO]' should be 371 and If I select just January, the value should be 21. How I can do that? 

Thanks a lot for your help.


1 Answer

2 like 0 dislike
by 160 200 388
selected by
 
Best answer

How to use DAX Measure based on Slicer in Power BI

To perform a DAX calculation based on slicer in Power BI, you have to do the following:

  1. Create a relation between the first and second table.
  2. In the second table, Instead of creating a calculated column, you have to create a measure with the below simple formula

     HOROMETROX = CALCULATE(SUM('HM POR EQUIPO'[HOROMETRO]))
    
  3. Add a slicer with Month Name from the first table.
  4. Try to filter now with two selections that should be calculated as expected in the second table.
    DAX OPERATIONS BASED ON SLICERS POWER BI

See Also

by 3 3 5
0 0
Thanks a lot
by 5 7 14
0 0
Hi @EliasCoronado, Don't forget to upvote and mark the answer as accepted in case it helped you!
If you don’t ask, the answer is always NO!
...