Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi everyone, I hope you are having a nice day
I was working on my report when I encountered the following problem. I have a table like the following:
PersonId | Category | Date | Value |
1 | 5 | 2023-12-01 | 10 |
1 | 6 | 2023-12-01 | 8 |
1 | 5 | 2023-12-02 | 6 |
3 | 5 | 2023-12-01 | 5 |
4 | 4 | 2023-12-01 | 1 |
What I need is to get, in a measure if possible, the value for each DATE in category 5. That is, I would like the final result to be as follows:
PersonId | Date | New Measure |
1 | 2023-12-01 | 10 |
1 | 2023-12-02 | 6 |
3 | 2023-12-01 | 5 |
Thank you very much in advance for your help,
Best regards
Solved! Go to Solution.
Hi, @AlvRomero
Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Measure:
MEASURE =
VAR _5 =
SELECTEDVALUE ( 'Table'[Category] )
VAR _value =
CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Category] = _5 ) )
RETURN
IF ( _5 = 5, _value )
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, thank you for your response.
When I apply the solution that you have provided me what happens is that it adds the sum of all the category to all the people, that is to say, the result that we obtain is the following one:
(I will put the result of the measure that you have provided me and the one we are looking for)
Thanks for your input, I hope we can find a solution to the problem,
Best Regards
Hi, @AlvRomero
You can change the SUM to Max, everything works fine on my side of the implementation, do you have any other filters on your data in Power BI Desktop that affect the implementation results?
Measure:
MEASURE1 =
VAR _5 =
SELECTEDVALUE ( 'Table'[Category] )
VAR _value =
CALCULATE ( MAX ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Category] = _5 ) ,ALL('Table'))
RETURN
IF ( _5 = 5, _value )
Best Regards,
Yang
Community Support Team
Hi, thank you for your response.
When I apply the solution that you have provided me what happens is that it adds the sum of all the category to all the people, that is to say, the result that we obtain is the following one:
(I will put the result of the measure that you have provided me and the one we are looking for)
Thanks for your input, I hope we can find a solution to the problem,
Best Regards
Hi, @AlvRomero
You can change the SUM to Max, everything works fine on my side of the implementation, do you have any other filters on your data in Power BI Desktop that affect the implementation results?
Measure:
MEASURE1 =
VAR _5 =
SELECTEDVALUE ( 'Table'[Category] )
VAR _value =
CALCULATE ( MAX ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Category] = _5 ) ,ALL('Table'))
RETURN
IF ( _5 = 5, _value )
Best Regards,
Yang
Community Support Team
Hi, @AlvRomero
Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Measure:
MEASURE =
VAR _5 =
SELECTEDVALUE ( 'Table'[Category] )
VAR _value =
CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Category] = _5 ) )
RETURN
IF ( _5 = 5, _value )
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
User | Count |
---|---|
89 | |
82 | |
53 | |
40 | |
35 |